Patchwork [8,of,8,V3] largefiles: simplify iteration over standins

login
register
mail settings
Submitter Martin von Zweigbergk
Date Sept. 24, 2014, 4:32 p.m.
Message ID <19987ec7d5f1f51b6a70.1411576334@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/5964/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Sept. 24, 2014, 4:32 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 19987ec7d5f1f51b6a70715a736b768b36e455cc
# Parent  9720c5b5defdc166c596a11b6aafbf804d66bc8b
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.
Pierre-Yves David - Sept. 24, 2014, 5:31 p.m.
On 09/24/2014 09:32 AM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@gmail.com>
> # Date 1410934239 25200
> #      Tue Sep 16 23:10:39 2014 -0700
> # Node ID 19987ec7d5f1f51b6a70715a736b768b36e455cc
> # Parent  9720c5b5defdc166c596a11b6aafbf804d66bc8b
> largefiles: simplify iteration over standins

I pushed the last 3 to the clowncopter. resendng the first 5 was 
unnecessary as they were already accepted.

Thanks for giving largefile some love.
Martin von Zweigbergk - Sept. 24, 2014, 5:35 p.m.
Thanks. (I'll leave out already accepted patches in the future.)

On Wed Sep 24 2014 at 10:31:05 AM Pierre-Yves David <
pierre-yves.david@ens-lyon.org> wrote:

>
>
> On 09/24/2014 09:32 AM, Martin von Zweigbergk wrote:
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz@gmail.com>
> > # Date 1410934239 25200
> > #      Tue Sep 16 23:10:39 2014 -0700
> > # Node ID 19987ec7d5f1f51b6a70715a736b768b36e455cc
> > # Parent  9720c5b5defdc166c596a11b6aafbf804d66bc8b
> > largefiles: simplify iteration over standins
>
> I pushed the last 3 to the clowncopter. resendng the first 5 was
> unnecessary as they were already accepted.
>
> Thanks for giving largefile some love.
>
> --
> Pierre-Yves David
>

Patch

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -193,9 +193,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