Patchwork largefiles: move identical statement to after if/else

login
register
mail settings
Submitter via Mercurial-devel
Date May 17, 2017, 5:26 a.m.
Message ID <acc0bd9507ba5daeaeca.1494998810@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20650/
State Accepted
Headers show

Comments

via Mercurial-devel - May 17, 2017, 5:26 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1494982047 25200
#      Tue May 16 17:47:27 2017 -0700
# Node ID acc0bd9507ba5daeaecabe26a066dc51288d9f01
# Parent  779a1ae6d0d9eeb487636f665747e92195eb234e
largefiles: move identical statement to after if/else
Gregory Szorc - May 17, 2017, 6:41 a.m.
On Tue, May 16, 2017 at 10:26 PM, Martin von Zweigbergk via Mercurial-devel
<mercurial-devel@mercurial-scm.org> wrote:

> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1494982047 25200
> #      Tue May 16 17:47:27 2017 -0700
> # Node ID acc0bd9507ba5daeaecabe26a066dc51288d9f01
> # Parent  779a1ae6d0d9eeb487636f665747e92195eb234e
> largefiles: move identical statement to after if/else
>

Queued.


>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -347,14 +347,12 @@
>                  else:
>                      f = m._cwd + '/' + f
>                  return back + lfutil.standin(f)
> -
> -            pats.update(fixpats(f, tostandin) for f in p)
>          else:
>              def tostandin(f):
>                  if lfutil.isstandin(f):
>                      return f
>                  return lfutil.standin(f)
> -            pats.update(fixpats(f, tostandin) for f in p)
> +        pats.update(fixpats(f, tostandin) for f in p)
>
>          for i in range(0, len(m._files)):
>              # Don't add '.hglf' to m.files, since that is already covered
> by '.'
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -347,14 +347,12 @@ 
                 else:
                     f = m._cwd + '/' + f
                 return back + lfutil.standin(f)
-
-            pats.update(fixpats(f, tostandin) for f in p)
         else:
             def tostandin(f):
                 if lfutil.isstandin(f):
                     return f
                 return lfutil.standin(f)
-            pats.update(fixpats(f, tostandin) for f in p)
+        pats.update(fixpats(f, tostandin) for f in p)
 
         for i in range(0, len(m._files)):
             # Don't add '.hglf' to m.files, since that is already covered by '.'