Commit Graph

79 Commits

Author SHA1 Message Date
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Gregory Szorc
16bb1ed421 verify: use absolute_import 2015-08-08 18:48:10 -07:00
Matt Mackall
89c8dd4cd3 censor: mark experimental option 2015-06-25 17:56:26 -05:00
Gregory Szorc
5380dea2a7 global: mass rewrite to use modern exception syntax
Python 2.6 introduced the "except type as instance" syntax, replacing
the "except type, instance" syntax that came before. Python 3 dropped
support for the latter syntax. Since we no longer support Python 2.4 or
2.5, we have no need to continue supporting the "except type, instance".

This patch mass rewrites the exception syntax to be Python 2.6+ and
Python 3 compatible.

This patch was produced by running `2to3 -f except -w -n .`.
2015-06-23 22:20:08 -07:00
Gregory Szorc
8e1cdd21f4 verify: print hint to run debugrebuildfncache
Corrupt fncache is now a recoverable operation. Inform the user how to
recover from this warning.
2015-06-20 20:11:53 -07:00
Matt Mackall
fa83df39d1 verify: clarify misleading fncache message
This is a message about cache corruption, not repository corruption or
actually missing files. Fix message and reduce to a warning.
2015-06-19 12:00:06 -05:00
Matt Mackall
9fdd0e8abe verify: add a note about a paleo-bug
In the very early days of hg, it was possible to commit /dev/null because our
patch importer was too simple. Repos from this era may still
exist, add a note about why we ignore this name.
2015-03-27 15:13:21 -05:00
Mike Edgar
49d296f5b7 verify: report censored nodes if configured policy is abort 2014-10-14 16:16:04 -04:00
Yuya Nishihara
6852c0bb11 verify: do not prevent verify repository containing hidden changesets
Since afe2bc876c89, repo.cancopy() cannot be used to check if the repo is
a bundlerepository.

repo.url() should always have "scheme:", so it isn't necessary to parse
by util.url().
2014-02-19 22:19:45 +09:00
Pierre-Yves David
a39281497e clfilter: verify logic should be unfiltered
To verify a changelog obviously needs all of it. The verify logic now
ensures it works on an unfiltered repository.
2012-10-08 17:08:52 +02:00
Bryan O'Sullivan
61197562ff verify: fix all doubled-slash sites (issue3665) 2012-10-24 09:27:47 -07:00
Bryan O'Sullivan
dde0f8331e verify: tolerate repeated slashes in a converted repo (issue3665)
These slashes are a hangover from issue3612, fixed in d5787cfaa7cf.

Although the bugfix in that commit is correct, the test it adds
does not replicate the conditions for the bug correctly.
2012-10-22 18:05:40 -07:00
FUJIWARA Katsunori
ec48173940 verify: rename "hasmanifest" variable for source code readability
Before this patch, there are two ambiguous variables: "havemf" and
"hasmanifest".

"havemf" means whether there are any "manifest" entries.

"hasmanifest" means whether there are any "changelog" entries
referring to "manifest" entry.

This patch renames from "hasmanifest" to "refersmf" to clear
difference from "havemf".
2012-10-04 01:24:05 +09:00
FUJIWARA Katsunori
beefacf118 verify: use appropriate local variable in "checkentry()"
Before this patch, "checkentry()" internal function uses both
"node"(argument of itself) and "n"(defined in outer of it) variables.

Because all callers of "checkentry()" use "n" to refer the object
which is passed to "checkentry()" as "node", both can refer same
object in "checkentry()". So, "checkentry()" works correctly.

But such usage is not good for independence of "checkentry()".

This patch replaces "n" in "checkentry()" with "node".
2012-10-04 01:24:05 +09:00
FUJIWARA Katsunori
07219f1b5d verify: use appropriate node information to show verification error
Before this patch, verify module shows verification error message
below:

    unknown parent 2 <HASH_OF_P2> of <HASH_OF_P1>

even though it should show:

    unknown parent 2 <HASH_OF_P2> of <HASH_OF_TARGET>

This patch uses appropriate node information.
2012-10-04 01:24:05 +09:00
Patrick Mezard
1e03a5cb1d verify: do not choke on valid changelog without manifest
Before this change:

  $ hg init
  $ hg branch foo
  $ hg ci -m branchfoo
  $ hg verify
  checking changesets
  checking manifests
   0: empty or missing manifest
  crosschecking files in changesets and manifests
  checking files
  0 files, 1 changesets, 0 total revisions
  1 integrity errors encountered!
  (first damaged changeset appears to be 0)
  [1]
2012-08-21 20:51:16 +02:00
Brodie Rao
a706d64a2c cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
Matt Mackall
80bded910a verify: fix mq misfire 2011-07-14 12:39:39 -05:00
Matt Mackall
d310d155f9 verify: filter messages about missing null manifests (issue2900) 2011-07-13 16:28:46 -05:00
Matt Mackall
1f03009146 verify: filter messages about missing null manifests (issue2900) 2011-07-13 16:28:46 -05:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
timeless
d78a15767f verify/progress: using gerund to indicate action and adding units 2010-08-02 07:15:47 +03:00
Thomas Arendsen Hein
48cd219ead verify: fix "missing revlog!" errors for revlog format v0 and add test
With revlog format v0 the .d files are empty if the only revision stored is an
empty file. Since Mercurial can no longer create format v0 repositories, but
still use it, add a script which creates a repository with a single empty file.
This can be used in other tests if wanted.
2010-09-05 22:32:11 +02:00
Matt Mackall
7ed158a8ab verify: initialize rp variable in case we hit out of memory 2010-08-05 16:17:33 -05:00
Matt Mackall
aa7e2a7659 verify: reduce memory footprint when unpacking files
By never holding a reference to the unpacked string, we avoid holding two
consecutive large files in memory.
2010-08-05 16:17:17 -05:00
Matt Mackall
6b7d6bea8c verify: report exceptions that don't have a str() method 2010-08-05 16:17:17 -05:00
Steve Borho
b31717c291 verify: improve progress descriptions
For GUIs, the progress bar is disconnected visually from the text that
is output by ui.write(), so it's better to be a little bit redundant in
naming the status.  "checking" is redundant, since the user is running
the verify command.  'changesets', 'manifests', etc, tell the user what
is being checked (the entity being counted in the progress bar.
2010-04-13 23:12:23 -05:00
Martin Geisler
f3b2ed5d56 progress: use a verb (+noun) in present participle 2010-03-15 18:33:39 +01:00
Martin Geisler
e2e1279b27 progress: mark strings for translation 2010-02-17 23:07:50 +01:00
Augie Fackler
458129e75a verify: call ui.progress() 2010-02-10 18:46:19 -06:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Sune Foldager
36a958fe4d verify: report existence of journal 2009-11-02 10:15:04 +01:00
Matt Mackall
a777761788 verify: filter the candidate list for broken linkrevs 2009-10-28 13:17:03 -05:00
Patrick Mezard
c463f2299e verify: detect file copy sources not in parents with --verbose 2009-10-06 22:46:31 +02:00
Martin Geisler
ae0794fd45 coding style: use a space after comma
I left a cases like 'lambda x,y:' alone -- the lack of a space does
not bother me as much when the variables are single letters.
2009-07-22 23:12:54 +02:00
Alejandro Santos
bc1b8b3654 verify: fix scope issues with del statement 2009-07-05 11:04:31 +02:00
Matt Mackall
3f99330a0a verify: demote warning about nullid in copy to note 2009-07-01 00:41:14 -05:00
Benoit Boissinot
f23fc93dd5 verify: use set instead of dict 2009-05-17 04:14:15 +02:00
Peter Arrenbrecht
35e8011b63 verify: detect manifest revs not in any changeset 2009-05-14 16:22:49 +02:00
Benoit Boissinot
fdd0aa0449 verify: reference the correct linkrev when a filelog is missing
when a filelog is missing, the first bad revision is the first revision
where the filelog is referenced, not 0.
2009-05-04 19:51:08 +02:00
Henrik Stuart
fbd8e53ee1 verify: avoid exception on missing file revlog
Previously, accessing the filelinkrevs of a specific file that happens to
have already been unlinked from the filesystem, e.g. due to a partial rollback
having occurred, will trigger a KeyError being raised.

Co-contributor: Sune Foldager <cryo@cyanite.org>
2009-04-24 10:44:39 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Martin Geisler
56c8ce33ee verify: combine sets instead of concatenating lists 2009-04-25 22:26:39 +02:00
Martin Geisler
44aa7e92d1 util: use built-in set instead of util.unique 2009-04-22 00:56:06 +02:00
Ronny Pfannschmidt
5356baa346 switch lock releasing in the core from gc to explicit 2009-04-22 02:01:22 +02:00
Wagner Bruna
b2fafee0f4 verify, i18n: fix unmarked strings 2009-03-29 19:56:53 -03:00
Peter Arrenbrecht
a2d3e23eef cleanup: drop variables for unused return values
They are unnecessary. I did leave them in localrepo.py where there is
something like:

  _junk = foo()
  _junk = None

to free memory early. I don't know if just `foo()` will free the return
value as early.
2009-03-23 13:13:02 +01:00
Benoit Boissinot
c34938cba1 verify: find correct first corrupted cset for missing/corrupted revlogs 2009-03-07 20:16:03 +01:00