comparison hgext/largefiles/lfcommands.py @ 18292:40185df018d7 stable

largefiles: make update with backup files in .hglf slightly less broken Largefiles update would try to copy f to f.orig if there was a .hglf/f.orig . That is in many many ways very very wrong, but it also caused an abort if f didn't exist. Now it only tries to copy f if it exists.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 10 Jan 2013 15:33:14 +0100
parents 0fc1ce271ee6
children 65cec7fa5472
comparison
equal deleted inserted replaced
18224:0f9013112eba 18292:40185df018d7
481 cache.''' 481 cache.'''
482 ret = 0 482 ret = 0
483 abslfile = repo.wjoin(lfile) 483 abslfile = repo.wjoin(lfile)
484 absstandin = repo.wjoin(lfutil.standin(lfile)) 484 absstandin = repo.wjoin(lfutil.standin(lfile))
485 if os.path.exists(absstandin): 485 if os.path.exists(absstandin):
486 if os.path.exists(absstandin+'.orig'): 486 if os.path.exists(absstandin + '.orig') and os.path.exists(abslfile):
487 shutil.copyfile(abslfile, abslfile+'.orig') 487 shutil.copyfile(abslfile, abslfile + '.orig')
488 expecthash = lfutil.readstandin(repo, lfile) 488 expecthash = lfutil.readstandin(repo, lfile)
489 if (expecthash != '' and 489 if (expecthash != '' and
490 (not os.path.exists(abslfile) or 490 (not os.path.exists(abslfile) or
491 expecthash != lfutil.hashfile(abslfile))): 491 expecthash != lfutil.hashfile(abslfile))):
492 if not lfutil.copyfromcache(repo, expecthash, lfile): 492 if not lfutil.copyfromcache(repo, expecthash, lfile):