sapling/tests/test-debugcheckcasecollisions.t
Mark Thomas 3f183f1756 debugcheckcasecollisions: implement treemanifest fastpath
Summary:
If the repo has treemanifests, we can use this to do the case check faster.

Note that with treemanifests we only find the first path component that
conflicts (subsequent conflicts won't be found), as these conflicts occur in
different trees.

Reviewed By: farnz

Differential Revision: D8332426

fbshipit-source-id: 243dab9bf711c6fdb62a0e0ba4346faea3b6b0ad
2018-06-12 09:23:44 -07:00

38 lines
1.5 KiB
Perl

$ newrepo
$ mkdir -p dirA/subdirA dirA/subdirB dirB
$ touch dirA/subdirA/file1 dirA/subdirB/file2 dirB/file3 file4
$ hg commit -Aqm "base"
Check basic case collisions
$ hg debugcheckcasecollisions DIRA/subdira/FILE1 DIRA/SUBDIRB/file2 DIRB/FILE3
DIRA/subdira/FILE1 conflicts with dirA/subdirA/file1
DIRA/subdira (directory for DIRA/subdira/FILE1) conflicts with dirA/subdirA (directory for dirA/subdirA/file1)
DIRA (directory for DIRA/SUBDIRB/file2) conflicts with dirA (directory for dirA/subdirA/file1)
DIRA/SUBDIRB/file2 conflicts with dirA/subdirB/file2
DIRA/SUBDIRB (directory for DIRA/SUBDIRB/file2) conflicts with dirA/subdirB (directory for dirA/subdirB/file2)
DIRB/FILE3 conflicts with dirB/file3
DIRB (directory for DIRB/FILE3) conflicts with dirB (directory for dirB/file3)
[1]
Check a dir that collides with a file
$ hg debugcheckcasecollisions FILE4/foo
FILE4 (directory for FILE4/foo) conflicts with file4
[1]
Check a file that collides with a dir
$ hg debugcheckcasecollisions DIRb
DIRb conflicts with dirB (directory for dirB/file3)
[1]
Check self-conflicts
$ hg debugcheckcasecollisions newdir/newfile NEWdir/newfile newdir/NEWFILE
NEWdir/newfile conflicts with newdir/newfile
NEWdir (directory for NEWdir/newfile) conflicts with newdir (directory for newdir/newfile)
newdir/NEWFILE conflicts with newdir/newfile
[1]
Check against a particular revision
$ hg debugcheckcasecollisions -r 0 FILE4
FILE4 conflicts with file4
[1]