Patchwork D6371: record: avoid modifying the matcher passed as a method parameter

login
register
mail settings
Submitter phabricator
Date May 12, 2019, 2:56 a.m.
Message ID <differential-rev-PHID-DREV-yq3nlshy2s4pvkuloh5s-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40012/
State Superseded
Headers show

Comments

phabricator - May 12, 2019, 2:56 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  No problem observed, but I remember the previous pattern causing problems with
  largefiles and/or subrepos.  This special matcher was added in https://phab.mercurial-scm.org/rHG419ac63fe29ccb38a97a9ed6d49632c7ba8e2745, so
  directly modifying the `fail` callback was probably an oversight in
  https://phab.mercurial-scm.org/rHG44611ad4fbd92183371c3e7d9a3f5ec490ea5114.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -278,8 +278,8 @@ 
         force = opts.get('force')
         if not force:
             vdirs = []
+            match = matchmod.badmatch(match, fail)
             match.explicitdir = vdirs.append
-            match.bad = fail
 
         status = repo.status(match=match)