D5481: sparse: fix debugrebuilddirsate when narrow extension is enabled

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Jan 9 19:48:14 UTC 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb05eb98a6b67: sparse: fix debugrebuilddirsate when narrow extension is enabled (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5481?vs=12975&id=13103

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

AFFECTED FILES
  hgext/sparse.py
  tests/test-narrow-sparse.t

CHANGE DETAILS

diff --git a/tests/test-narrow-sparse.t b/tests/test-narrow-sparse.t
--- a/tests/test-narrow-sparse.t
+++ b/tests/test-narrow-sparse.t
@@ -67,43 +67,3 @@
   treemanifest (tree !)
 
   $ hg debugrebuilddirstate
-  ** unknown exception encountered, please report by visiting
-  ** https://mercurial-scm.org/wiki/BugTracker
-  ** Python 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609]
-  ** Mercurial Distributed SCM (version 4.8.1+588-479a5ea51ccc+20181224)
-  ** Extensions loaded: narrow, sparse
-  Traceback (most recent call last):
-    File "/place/vartmp/hgtests.zMelCK/install/bin/hg", line 43, in <module>
-      dispatch.run()
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 99, in run
-      status = dispatch(req)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 225, in dispatch
-      ret = _runcatch(req) or 0
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 376, in _runcatch
-      return _callcatch(ui, _runcatchfunc)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 384, in _callcatch
-      return scmutil.callcatch(ui, func)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/scmutil.py", line 166, in callcatch
-      return func()
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 367, in _runcatchfunc
-      return _dispatch(req)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 1021, in _dispatch
-      cmdpats, cmdoptions)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 756, in runcommand
-      ret = _runcommand(ui, options, cmd, d)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 1030, in _runcommand
-      return cmdfunc()
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/dispatch.py", line 1018, in <lambda>
-      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/util.py", line 1670, in check
-      return func(*args, **kwargs)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/debugcommands.py", line 1998, in debugrebuilddirstate
-      dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/hgext/narrow/narrowdirstate.py", line 60, in rebuild
-      super(narrowdirstate, self).rebuild(parent, allfiles, changedfiles)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/mercurial/extensions.py", line 437, in closure
-      return func(*(args + a), **kw)
-    File "/place/vartmp/hgtests.zMelCK/install/lib/python/hgext/sparse.py", line 213, in _rebuild
-      allfiles = allfiles.matches(matcher)
-  AttributeError: 'list' object has no attribute 'matches'
-  [1]
diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -210,7 +210,7 @@
     def _rebuild(orig, self, parent, allfiles, changedfiles=None):
         matcher = self._sparsematcher
         if not matcher.always():
-            allfiles = allfiles.matches(matcher)
+            allfiles = [f for f in allfiles if matcher(f)]
             if changedfiles:
                 changedfiles = [f for f in changedfiles if matcher(f)]
 



To: pulkit, durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list