Patchwork D5892: patch: let caller pass in root-filtering matcher (API)

login
register
mail settings
Submitter phabricator
Date Feb. 9, 2019, 9:35 p.m.
Message ID <8143593f0165fd822e3a6db96f11b4fd@localhost.localdomain>
Download mbox | patch
Permalink /patch/38585/
State Not Applicable
Headers show

Comments

phabricator - Feb. 9, 2019, 9:35 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG035cae1d197f: patch: let caller pass in root-filtering matcher (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5892?vs=13906&id=13949

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

AFFECTED FILES
  mercurial/logcmdutil.py
  mercurial/patch.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -32,7 +32,6 @@ 
     encoding,
     error,
     mail,
-    match as matchmod,
     mdiff,
     pathutil,
     pycompat,
@@ -2320,10 +2319,6 @@ 
         return getfilectx
     getfilectx = lrugetfilectx()
 
-    if relroot:
-        relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
-        match = matchmod.intersectmatchers(match, relrootmatch)
-
     if not changes:
         changes = ctx1.status(ctx2, match=match)
     modified, added, removed = changes[:3]
diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -74,6 +74,9 @@ 
                 ui.warn(_('warning: %s not inside relative root %s\n') % (
                     match.uipath(matchroot), uirelroot))
 
+        relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
+        match = matchmod.intersectmatchers(match, relrootmatch)
+
     if stat:
         diffopts = diffopts.copy(context=0, noprefix=False)
         width = 80