D5178: archive: use manifest.matches() to simplify and speed up matching

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Oct 20 18:33:01 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  manifest.matches() can avoid walking paths the user did not want to
  archive.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS

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



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


More information about the Mercurial-devel mailing list