comparison hgext/largefiles/lfutil.py @ 16103:3e1efb458e8b stable

largefiles: only cache largefiles in new heads This fixes a serious performance regression in largefiles introduced in Mercurial 2.1. Caching new largefiles on pull is necessary, because otherwise largefiles will be missing (and unable to be downloaded) when the user tries to merge or rebase a new head with an old one. But this is an expensive operation and should only be done for heads that are new from the pull, rather than on all heads in the repository.
author Na'Tosha Bard <natosha@unity3d.com>
date Fri, 10 Feb 2012 14:46:09 +0100
parents 6a42846cf769
children 47ee41fcf42b 05197f9fd1f3
comparison
equal deleted inserted replaced
16101:20ad8f0512a2 16103:3e1efb458e8b
447 return tempfile.mkstemp(prefix=prefix, dir=path) 447 return tempfile.mkstemp(prefix=prefix, dir=path)
448 448
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