1. idank
  2. mercurial

Commits

Na'Tosha Bard  committed a18ad91

largefiles: move calculation of largefiles for updating to utility function

  • Participants
  • Parent commits 60cc3a0
  • Branches default

Comments (0)

Files changed (2)

File hgext/largefiles/lfutil.py

View file
  • Ignore whitespace
         lfile = splitstandin(standin)
         standins.append((lfile, readstandin(repo, lfile)))
     return standins
+
+def getlfilestoupdate(oldstandins, newstandins):
+    changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
+    filelist = []
+    for f in changedstandins:
+        if f[0] not in filelist:
+            filelist.append(f[0])
+    return filelist

File hgext/largefiles/overrides.py

View file
  • Ignore whitespace
         wlock.release()
 
 def hg_update(orig, repo, node):
-    # In order to not waste a lot of extra time during the update largefiles
-    # step, we keep track of the state of the standins before and after we
-    # call the original update function, and only update the standins that
-    # have changed in the hg.update() call
+    # Only call updatelfiles the standins that have changed to save time
     oldstandins = lfutil.getstandinsstate(repo)
     result = orig(repo, node)
     newstandins = lfutil.getstandinsstate(repo)
-    tobeupdated = set(oldstandins).symmetric_difference(set(newstandins))
-    filelist = []
-    for f in tobeupdated:
-        if f[0] not in filelist:
-            filelist.append(f[0])
-
+    filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
     lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
     return result