Commit Graph

16 Commits

Author SHA1 Message Date
Martin von Zweigbergk
14f6b76d16 tests: fix typo in "flagprocesor" 2017-05-31 10:35:10 -07:00
Jun Wu
ac08ec9cb1 verify: add a config option to skip certain flag processors
Previously, "hg verify" verifies everything, which could be undesirable when
there are expensive flag processor contents.

This patch adds a "verify.skipflags" developer config. A flag processor will
be skipped if (flag & verify.skipflags) == 0.

In the LFS usecase, that means "hg verify --config verify.skipflags=8192"
will not download all LFS blobs, which could be too large to be stored
locally.

Note: "renamed" is also skipped since its default implementation may call
filelog.data() which will trigger the flag processor.
2017-05-14 09:38:06 -07:00
Jun Wu
3ee7ba0bd8 tests: replace "cp -r" with "cp -R"
The POSIX documentation about "cp" [1] says:

  ....

  RATIONALE
    ....
    Earlier versions of this standard included support for the -r option to
    copy file hierarchies. The -r option is historical practice on BSD and
    BSD-derived systems. This option is no longer specified by POSIX.1-2008
    but may be present in some implementations. The -R option was added as a
    close synonym to the -r option, selected for consistency with all other
    options in this volume of POSIX.1-2008 that do recursive directory
    descent.

    The difference between -R and the removed -r option is in the treatment
    by cp of file types other than regular and directory. It was
    implementation-defined how the - option treated special files to allow
    both historical implementations and those that chose to support -r with
    the same abilities as -R defined by this volume of POSIX.1-2008. The
    original -r flag, for historic reasons, did not handle special files any
    differently from regular files, but always read the file and copied its
    contents. This had obvious problems in the presence of special file
    types; for example, character devices, FIFOs, and sockets.
    ....

  ....

  Issue 6
    The -r option is marked obsolescent.
    ....

  Issue 7
    ....
    The obsolescent -r option is removed.
    ....

  (No "Issue 8" yet)

Therefore it's clear that "cp -R" is strictly better than "cp -r".

The issue was discovered when running tests on OS X after 2e4d149e62aa.

[1]: pubs.opengroup.org/onlinepubs/9699919799/utilities/cp.html
2016-11-30 19:25:18 +00:00
Tony Tung
0ed99a4989 treemanifest: use "cp xyz/." instead of "cp xyz/*"
This is more similar to cp -T because it covers hidden files.
2016-02-23 17:22:51 -08:00
Martin von Zweigbergk
8868dab63d verify: use similar language for missing manifest and file revisions
When a changeset refers to a manifest revision that's not found in the
manifest log, we say "changeset refers to missing revision X", but
when a manifest refers to file revision that's not found in the
filelog, we say "X in manifests not found". The language used for
missing manifest revisions seems clearer, so let's use that for
missing filelog revisions too.
2016-02-07 22:46:20 -08:00
Martin von Zweigbergk
0e98867ba2 verify: include "manifest" prefix in a few more places
We include the "manifest" prefix on most other errors, so it seems
consistent to add them to the remaining messages too. Also, having the
"manifest" prefix will be more consistent with having the directory
prefix there when we add support for treemanifests. With the
"manifest" at the beginning, let's remove the now-redundant
"manifest" in the message itself.
2016-02-02 10:42:28 -08:00
Martin von Zweigbergk
7eefa4f76d tests: add tests for missing revlogs and revlog entries
The verify code is pretty poorly tested. It's easy to test missing
revlogs and missing revlog entries, so let's add tests for that.

Also add some more tests corrupting each type of revlog, so we test
the messages presented when reading a revision fails. The pure and
native implementations produce different error messages, so we have to
use (glob) in the tests.
2016-01-31 21:55:52 -08: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
3ad28905f6 tests: drop explicit $TESTDIR from executables
$TESTDIR is added to the path, so this is superfluous. Also,
inconsistent use of quotes means we might have broken on tests with
paths containing spaces.
2015-06-08 14:44:30 -05: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
Mads Kiilerich
9355854f8a tests: cleanup of tests that got lost in their own nested directories
Some tests ended up in a directory several directories deeper than $TESTTMP,
usually because some 'cd ..' had been forgotten between different test cases.

Add 'cd ..' where they are missing so the tests get back where they started.
2012-06-11 01:38:32 +02:00
Matt Mackall
bf9417da11 tests: exit 0 no longer needed on unified tests 2010-09-17 17:03:04 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Thomas Arendsen Hein
3dfb90c158 merge with stable 2010-09-06 07:14:18 +02:00
Nicolas Dumazet
0ce87f8272 tests: unify test-verify 2010-08-12 15:41:58 +09:00