##// END OF EJS Templates
largefiles: simplify cachelfiles - don't spend a lot of time checking hashes...
Mads Kiilerich -
r18728:1e636f7b stable
parent child Browse files
Show More
@@ -8,7 +8,7 b''
8
8
9 '''High-level command function for lfconvert, plus the cmdtable.'''
9 '''High-level command function for lfconvert, plus the cmdtable.'''
10
10
11 import os
11 import os, errno
12 import shutil
12 import shutil
13
13
14 from mercurial import util, match as match_, hg, node, context, error, \
14 from mercurial import util, match as match_, hg, node, context, error, \
@@ -403,22 +403,13 b' def cachelfiles(ui, repo, node, filelist'
403 toget = []
403 toget = []
404
404
405 for lfile in lfiles:
405 for lfile in lfiles:
406 # If we are mid-merge, then we have to trust the standin that is in the
406 try:
407 # working copy to have the correct hashvalue. This is because the
408 # original hg.merge() already updated the standin as part of the normal
409 # merge process -- we just have to update the largefile to match.
410 if (getattr(repo, "_ismerging", False) and
411 os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
412 expectedhash = lfutil.readstandin(repo, lfile)
413 else:
414 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
407 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
415
408 except IOError, err:
416 # if it exists and its hash matches, it might have been locally
409 if err.errno == errno.ENOENT:
417 # modified before updating and the user chose 'local'. in this case,
410 continue # node must be None and standin wasn't found in wctx
418 # it will not be in any store, so don't look for it.
411 raise
419 if ((not os.path.exists(repo.wjoin(lfile)) or
412 if not lfutil.findfile(repo, expectedhash):
420 expectedhash != lfutil.hashfile(repo.wjoin(lfile))) and
421 not lfutil.findfile(repo, expectedhash)):
422 toget.append((lfile, expectedhash))
413 toget.append((lfile, expectedhash))
423
414
424 if toget:
415 if toget:
@@ -684,15 +684,8 b' def hgupdaterepo(orig, repo, node, overw'
684 return result
684 return result
685
685
686 def hgmerge(orig, repo, node, force=None, remind=True):
686 def hgmerge(orig, repo, node, force=None, remind=True):
687 # Mark the repo as being in the middle of a merge, so that
687 result = orig(repo, node, force, remind)
688 # updatelfiles() will know that it needs to trust the standins in
688 lfcommands.updatelfiles(repo.ui, repo)
689 # the working copy, not in the standins in the current node
690 repo._ismerging = True
691 try:
692 result = orig(repo, node, force, remind)
693 lfcommands.updatelfiles(repo.ui, repo)
694 finally:
695 repo._ismerging = False
696 return result
689 return result
697
690
698 # When we rebase a repository with remotely changed largefiles, we need to
691 # When we rebase a repository with remotely changed largefiles, we need to
General Comments 0
You need to be logged in to leave comments. Login now