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

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Sat May 11 22:56:24 EDT 2019


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

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)
 



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


More information about the Mercurial-devel mailing list