Patchwork [2,of,2] largefiles: always consider updatelfiles 'checked' parameter set

login
register
mail settings
Submitter Mads Kiilerich
Date April 15, 2015, 7:22 p.m.
Message ID <560a632655edeba986d4.1429125772@localhost.localdomain>
Download mbox | patch
Permalink /patch/8686/
State Accepted
Headers show

Comments

Mads Kiilerich - April 15, 2015, 7:22 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1421462097 -3600
#      Sat Jan 17 03:34:57 2015 +0100
# Node ID 560a632655edeba986d4c9cfdc69d7bc64ab4218
# Parent  e65b603cd5e24f877d1aa93f45e4324fd2cb36f9
largefiles: always consider updatelfiles 'checked' parameter set

mergeupdate already set the flag to update all. This will thus only change
overriderevert and scmutilmarktouched ... where the flag effectually also were
true. The test coverage thus shows no change.

As the flag always is set, it is removed.

This is mainly a change for keeping the code simple and consistent and correct,
but it should also make it faster in many cases.
Matt Mackall - April 17, 2015, 12:24 a.m.
On Wed, 2015-04-15 at 15:22 -0400, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1421462097 -3600
> #      Sat Jan 17 03:34:57 2015 +0100
> # Node ID 560a632655edeba986d4c9cfdc69d7bc64ab4218
> # Parent  e65b603cd5e24f877d1aa93f45e4324fd2cb36f9
> largefiles: always consider updatelfiles 'checked' parameter set

These two are queued for default, thanks.

Patch

diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -437,7 +437,7 @@  def downloadlfiles(ui, repo, rev=None):
     return totalsuccess, totalmissing
 
 def updatelfiles(ui, repo, filelist=None, printmessage=None,
-                 normallookup=False, checked=False):
+                 normallookup=False):
     '''Update largefiles according to standins in the working directory
 
     If ``printmessage`` is other than ``None``, it means "print (or
@@ -464,10 +464,7 @@  def updatelfiles(ui, repo, filelist=None
                     shutil.copyfile(abslfile, abslfile + '.orig')
                     util.unlinkpath(absstandin + '.orig')
                 expecthash = lfutil.readstandin(repo, lfile)
-                if (expecthash != '' and
-                    (checked or
-                     not os.path.exists(abslfile) or
-                     expecthash != lfutil.hashfile(abslfile))):
+                if expecthash != '':
                     if lfile not in repo[None]: # not switched to normal file
                         util.unlinkpath(abslfile, ignoremissing=True)
                     # use normallookup() to allocate an entry in largefiles
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1348,7 +1348,7 @@  def mergeupdate(orig, repo, node, branch
             filelist.extend(s.deleted + s.removed)
 
         lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
-                                normallookup=partial, checked=True)
+                                normallookup=partial)
 
         return result
     finally: