##// END OF EJS Templates
largefiles: move calculation of largefiles for updating to utility function
Na'Tosha Bard -
r16245:a18ad914 default
parent child Browse files
Show More
@@ -457,3 +457,11 b' def getstandinsstate(repo):'
457 457 lfile = splitstandin(standin)
458 458 standins.append((lfile, readstandin(repo, lfile)))
459 459 return standins
460
461 def getlfilestoupdate(oldstandins, newstandins):
462 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
463 filelist = []
464 for f in changedstandins:
465 if f[0] not in filelist:
466 filelist.append(f[0])
467 return filelist
@@ -602,19 +602,11 b' def override_revert(orig, ui, repo, *pat'
602 602 wlock.release()
603 603
604 604 def hg_update(orig, repo, node):
605 # In order to not waste a lot of extra time during the update largefiles
606 # step, we keep track of the state of the standins before and after we
607 # call the original update function, and only update the standins that
608 # have changed in the hg.update() call
605 # Only call updatelfiles the standins that have changed to save time
609 606 oldstandins = lfutil.getstandinsstate(repo)
610 607 result = orig(repo, node)
611 608 newstandins = lfutil.getstandinsstate(repo)
612 tobeupdated = set(oldstandins).symmetric_difference(set(newstandins))
613 filelist = []
614 for f in tobeupdated:
615 if f[0] not in filelist:
616 filelist.append(f[0])
617
609 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
618 610 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
619 611 return result
620 612
General Comments 0
You need to be logged in to leave comments. Login now