Patchwork D8083: archival: use walk() instead of matches() on manifest

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2020, 10:34 p.m.
Message ID <differential-rev-PHID-DREV-wxctk7pl2awxxagfbyz7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44966/
State Superseded
Headers show

Comments

phabricator - Feb. 5, 2020, 10:34 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  All we care about is the filepaths, so this avoids a pointless copy of the
  manifest that we only used to extract matching filenames.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 6, 2020, 5:02 p.m.
martinvonz added a comment.


  Oops, I queued this one out of order because I wanted to think more about the previous two patches first, but that made `test-subrepo-deep-nested-change.t` fail. I should have known there was a reason for the order in this series. I'll de-queue this one for now, so please revive your local copy.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8083/new/

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

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

Patch

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -355,7 +355,7 @@ 
         if match(name):
             write(name, 0o644, False, lambda: buildmetadata(ctx))
 
-    files = [f for f in ctx.manifest().matches(match)]
+    files = list(ctx.manifest().walk(match))
     total = len(files)
     if total:
         files.sort()