[PATCH 8 of 8 v2] largefiles: simplify iteration over standins

Martin von Zweigbergk martinvonz at gmail.com
Tue Sep 23 16:46:13 CDT 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at gmail.com>
# Date 1410934239 25200
#      Tue Sep 16 23:10:39 2014 -0700
# Node ID 655dc947d1484a57b1a088af527ce3f2fdea9846
# Parent  7da73fc0e398fe0f69cea666f20a39f397f37aed
largefiles: simplify iteration over standins

Instead of iterating over all files in the context and ignoring those
that are not standins, pass a standin-matcher to the context and
iterate over only the files matching.

Apart from making the intent clearer, this implementation will also
benefit from any future optimizations done to the manifest walking
code.

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -192,9 +192,7 @@
 
                     # Standins no longer found in lfdirstate has been
                     # removed
-                    for standin in ctx1.manifest():
-                        if not lfutil.isstandin(standin):
-                            continue
+                    for standin in ctx1.walk(lfutil.getstandinmatcher(self)):
                         lfile = lfutil.splitstandin(standin)
                         if not match(lfile):
                             continue


More information about the Mercurial-devel mailing list