Patchwork D5361: rebase: fix path auditing to audit path relative to repo root (issue5818)

login
register
mail settings
Submitter phabricator
Date Dec. 4, 2018, 10:20 p.m.
Message ID <4f2514bd654712588f54d18e66f28e5a@localhost.localdomain>
Download mbox | patch
Permalink /patch/36967/
State Not Applicable
Headers show

Comments

phabricator - Dec. 4, 2018, 10:20 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1c8c54cf9725: rebase: fix path auditing to audit path relative to repo root (issue5818) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5361?vs=12699&id=12704

REVISION DETAIL
  https://phab.mercurial-scm.org/D5361

AFFECTED FILES
  mercurial/context.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -279,8 +279,7 @@ 
   created new head
   $ hg rebase -s 1 -d .
   rebasing 1:* "b" (glob)
-  abort: path '*/lib/b' traverses symbolic link '*/lib' (glob)
-  [255]
+  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-rebase.hg (glob)
   $ cd ..
 
 Test dry-run rebasing
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1848,8 +1848,8 @@ 
                 fail(path, component)
 
         # Test the other direction -- that this path from p2 isn't a directory
-        # in p1 (test that p1 doesn't any paths matching `path/*`).
-        match = matchmod.match('/', '', [path + '/'], default=b'relpath')
+        # in p1 (test that p1 doesn't have any paths matching `path/*`).
+        match = self.match(pats=[path + '/'], default=b'path')
         matches = self.p1().manifest().matches(match)
         mfiles = matches.keys()
         if len(mfiles) > 0: