tests: show bad path auditing in in-memory rebase stable
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 04 Dec 2018 08:56:43 -0800
branchstable
changeset 53581 d10b1dc134316c13c637232fc52389aa24319e12
parent 53580 9b1d5eea07f9be73df44f70a65cbc511f8063f81
child 53582 1c8c54cf97256f4468da2eb4dbee24f7f3888e71
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
tests: show bad path auditing in in-memory rebase Thanks to Yuya for providing this test case in https://bz.mercurial-scm.org/show_bug.cgi?id=5818. Differential Revision: https://phab.mercurial-scm.org/D5368
tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -252,16 +252,42 @@ Test reporting of path conflicts
   $ hg rebase -r 3 -d . -n
   starting dry-run rebase; repository will not be changed
   rebasing 3:844a7de3e617 "c"
   abort: error: file 'c' cannot be written because  'c/' is a folder in 755f0104af9b (containing 1 entries: c/c)
   [255]
 
   $ cd ..
 
+Test path auditing (issue5818)
+
+  $ mkdir lib_
+  $ ln -s lib_ lib
+  $ hg init repo
+  $ cd repo
+  $ mkdir -p ".$TESTTMP/lib"
+  $ touch ".$TESTTMP/lib/a"
+  $ hg add ".$TESTTMP/lib/a"
+  $ hg ci -m 'a'
+
+  $ touch ".$TESTTMP/lib/b"
+  $ hg add ".$TESTTMP/lib/b"
+  $ hg ci -m 'b'
+
+  $ hg up -q '.^'
+  $ touch ".$TESTTMP/lib/c"
+  $ hg add ".$TESTTMP/lib/c"
+  $ hg ci -m 'c'
+  created new head
+  $ hg rebase -s 1 -d .
+  rebasing 1:* "b" (glob)
+  abort: path '*/lib/b' traverses symbolic link '*/lib' (glob)
+  [255]
+  $ cd ..
+
 Test dry-run rebasing
 
   $ hg init repo3
   $ cd repo3
   $ echo a>a
   $ hg ci -Aqma
   $ echo b>b
   $ hg ci -Aqmb