##// END OF EJS Templates
largefiles: only cache largefiles in new heads...
Na'Tosha Bard -
r16103:3e1efb45 stable
parent child Browse files
Show More
@@ -449,3 +449,11 b' def mkstemp(repo, prefix):'
449 class storeprotonotcapable(Exception):
449 class storeprotonotcapable(Exception):
450 def __init__(self, storetypes):
450 def __init__(self, storetypes):
451 self.storetypes = storetypes
451 self.storetypes = storetypes
452
453 def getcurrentheads(repo):
454 branches = repo.branchmap()
455 heads = []
456 for branch in branches:
457 newheads = repo.branchheads(branch)
458 heads = heads + newheads
459 return heads
@@ -660,6 +660,7 b' def override_pull(orig, ui, repo, source'
660 repo.lfpullsource = source
660 repo.lfpullsource = source
661 if not source:
661 if not source:
662 source = 'default'
662 source = 'default'
663 oldheads = lfutil.getcurrentheads(repo)
663 result = orig(ui, repo, source, **opts)
664 result = orig(ui, repo, source, **opts)
664 # If we do not have the new largefiles for any new heads we pulled, we
665 # If we do not have the new largefiles for any new heads we pulled, we
665 # will run into a problem later if we try to merge or rebase with one of
666 # will run into a problem later if we try to merge or rebase with one of
@@ -667,10 +668,9 b' def override_pull(orig, ui, repo, source'
667 # cache.
668 # cache.
668 ui.status(_("caching new largefiles\n"))
669 ui.status(_("caching new largefiles\n"))
669 numcached = 0
670 numcached = 0
670 branches = repo.branchmap()
671 heads = lfutil.getcurrentheads(repo)
671 for branch in branches:
672 newheads = set(heads).difference(set(oldheads))
672 heads = repo.branchheads(branch)
673 for head in newheads:
673 for head in heads:
674 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
674 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
675 numcached += len(cached)
675 numcached += len(cached)
676 ui.status(_("%d largefiles cached\n" % numcached))
676 ui.status(_("%d largefiles cached\n" % numcached))
General Comments 0
You need to be logged in to leave comments. Login now