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

Mads Kiilerich mads at kiilerich.com
Wed Apr 15 14:22:52 CDT 2015


# HG changeset patch
# User Mads Kiilerich <madski at 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.

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:


More information about the Mercurial-devel mailing list