[PATCH 8 of 8] largefiles: inline redundant toname function in status

Martin von Zweigbergk martinvonz at gmail.com
Tue Oct 14 23:50:58 CDT 2014


On Tue, Oct 14, 2014 at 8:09 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1413342536 -7200
> #      Wed Oct 15 05:08:56 2014 +0200
> # Node ID defd3115ade0f094bcbd2f380cfffa3df5705b04
> # Parent  05f6422005091798fbe0f2a8d4d5d66ca2c78f28
> largefiles: inline redundant toname function in status
>
> Simpler and an optimization.
>
> diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
> --- a/hgext/largefiles/reposetup.py
> +++ b/hgext/largefiles/reposetup.py
> @@ -217,12 +217,8 @@ def reposetup(ui, repo):
>                                  clean)
>                      result = [sorted(list1 + list2)
>                                for (list1, list2) in zip(normals, lfstatus)]
> -                else:
> -                    def toname(f):
> -                        if lfutil.isstandin(f):
> -                            return lfutil.splitstandin(f)
> -                        return f
> -                    result = [[toname(f) for f in items]
> +                else: # not against working directory
> +                    result = [[lfutil.splitstandin(f) or f for f in items]

It's not obvious to me why this is equivalent. Are all the files in
'items' standins (so lfutil.isstandin() returns True)?

FWIW, 1-7 look good to me, although I don't know if number 2 (the mq
patch) was much of an improvement; I thought it looked fine both
before and after.


More information about the Mercurial-devel mailing list