Patchwork [9,of,9] largefiles: simplify iteration over standins

login
register
mail settings
Submitter Martin von Zweigbergk
Date Sept. 17, 2014, 8:40 p.m.
Message ID <2cfc907f98e11ae2fbe8.1410986426@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/5862/
State Superseded
Commit 764127f58903c2b0c044f8f20c83976e1259d61d
Headers show

Comments

Martin von Zweigbergk - Sept. 17, 2014, 8:40 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@gmail.com>
# Date 1410934239 25200
#      Tue Sep 16 23:10:39 2014 -0700
# Node ID 2cfc907f98e11ae2fbe8336c858a348ce2b5d1a7
# Parent  0e7f51097cdb5364b0fb45dcee38b9ffbf06ec16
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.

Patch

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