Patchwork D6224: overlayworkingctx: remove misleading trailing slash from directory pattern

login
register
mail settings
Submitter phabricator
Date April 11, 2019, 12:51 a.m.
Message ID <differential-rev-PHID-DREV-7tgbeeb7na2tz75zcuex-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39554/
State Superseded
Headers show

Comments

phabricator - April 11, 2019, 12:51 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The paths passed into the matcher are normalized (this applies to
  include patterns and regular patterns, and to both glob kind and path
  kind), so the regex for input "foo/" ended up being "foo(?:/|$)".
  
  Once we have a (recursive) pattern kind only for directories, we could
  switch to that here and remove the "mfiles[0] == path" check. Until
  then, let's at least make it not misleading.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1954,7 +1954,7 @@ 
 
         # Test the other direction -- that this path from p2 isn't a directory
         # in p1 (test that p1 doesn't have any paths matching `path/*`).
-        match = self.match([path + '/'], default=b'path')
+        match = self.match([path], default=b'path')
         matches = self.p1().manifest().matches(match)
         mfiles = matches.keys()
         if len(mfiles) > 0: