2010-08-14 04:26:58 +04:00
|
|
|
$ hg init
|
|
|
|
|
2012-06-10 20:50:42 +04:00
|
|
|
audit of .hg
|
2010-08-14 04:26:58 +04:00
|
|
|
|
|
|
|
$ hg add .hg/00changelog.i
|
2011-11-07 06:25:10 +04:00
|
|
|
abort: path contains illegal component: .hg/00changelog.i (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:26:58 +04:00
|
|
|
|
2012-06-10 20:50:42 +04:00
|
|
|
#if symlink
|
|
|
|
|
|
|
|
Symlinks
|
|
|
|
|
2010-08-14 04:26:58 +04:00
|
|
|
$ mkdir a
|
|
|
|
$ echo a > a/a
|
|
|
|
$ hg ci -Ama
|
|
|
|
adding a/a
|
|
|
|
$ ln -s a b
|
|
|
|
$ echo b > a/b
|
|
|
|
$ hg add b/b
|
2011-11-07 06:25:10 +04:00
|
|
|
abort: path 'b/b' traverses symbolic link 'b' (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:26:58 +04:00
|
|
|
$ hg add b
|
|
|
|
|
|
|
|
should still fail - maybe
|
|
|
|
|
|
|
|
$ hg add b/b
|
2011-11-07 06:25:10 +04:00
|
|
|
abort: path 'b/b' traverses symbolic link 'b' (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:26:58 +04:00
|
|
|
|
2012-06-10 20:50:42 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2010-08-14 04:26:58 +04:00
|
|
|
unbundle tampered bundle
|
|
|
|
|
|
|
|
$ hg init target
|
|
|
|
$ cd target
|
2012-04-03 21:06:35 +04:00
|
|
|
$ hg unbundle "$TESTDIR/bundles/tampered.hg"
|
2010-08-14 04:26:58 +04:00
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 5 changesets with 6 changes to 6 files (+4 heads)
|
|
|
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
|
|
|
|
|
|
|
attack .hg/test
|
|
|
|
|
|
|
|
$ hg manifest -r0
|
|
|
|
.hg/test
|
|
|
|
$ hg update -Cr0
|
2012-06-10 20:50:42 +04:00
|
|
|
abort: path contains illegal component: .hg/test (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:26:58 +04:00
|
|
|
|
|
|
|
attack foo/.hg/test
|
|
|
|
|
|
|
|
$ hg manifest -r1
|
|
|
|
foo/.hg/test
|
|
|
|
$ hg update -Cr1
|
2012-06-10 20:50:42 +04:00
|
|
|
abort: path 'foo/.hg/test' is inside nested repo 'foo' (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:26:58 +04:00
|
|
|
|
|
|
|
attack back/test where back symlinks to ..
|
|
|
|
|
|
|
|
$ hg manifest -r2
|
|
|
|
back
|
|
|
|
back/test
|
2012-06-10 20:50:42 +04:00
|
|
|
#if symlink
|
2010-08-14 04:26:58 +04:00
|
|
|
$ hg update -Cr2
|
|
|
|
abort: path 'back/test' traverses symbolic link 'back'
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2012-06-10 20:50:42 +04:00
|
|
|
#else
|
|
|
|
('back' will be a file and cause some other system specific error)
|
|
|
|
$ hg update -Cr2
|
|
|
|
abort: * (glob)
|
|
|
|
[255]
|
|
|
|
#endif
|
2010-08-14 04:26:58 +04:00
|
|
|
|
|
|
|
attack ../test
|
|
|
|
|
|
|
|
$ hg manifest -r3
|
|
|
|
../test
|
|
|
|
$ hg update -Cr3
|
2012-06-10 20:50:42 +04:00
|
|
|
abort: path contains illegal component: ../test (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2010-08-14 04:26:58 +04:00
|
|
|
|
|
|
|
attack /tmp/test
|
|
|
|
|
|
|
|
$ hg manifest -r4
|
|
|
|
/tmp/test
|
|
|
|
$ hg update -Cr4
|
2011-11-16 06:45:14 +04:00
|
|
|
abort: *: $TESTTMP/target//tmp/test (glob)
|
2010-09-17 02:51:32 +04:00
|
|
|
[255]
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|