comparison hgext/largefiles/overrides.py @ 23695:997a96cf6344 stable

largefiles: mark lfile as added in lfdirstate when the standin is added This is an alternative solution to the problem addressed by f72d73937853. This implementation has the advantage that it doesn't mark clean largefiles as normallookup. We can thus avoid repeated rehashing of all largefiles when f72d73937853 is backed out. This implementation use the existing 'lfmr' actions that 23fe278bde43 introduced for handling another part of the same cases.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 31 Dec 2014 14:46:02 +0100
parents 70afc58c32d3
children 3314664606e6 1b3df5ef5949
comparison
equal deleted inserted replaced
23694:97eb62b0f4a9 23695:997a96cf6344
443 return actions 443 return actions
444 444
445 removes = set(a[0] for a in actions['r']) 445 removes = set(a[0] for a in actions['r'])
446 446
447 newglist = [] 447 newglist = []
448 lfmr = [] # LargeFiles: Mark as Removed 448 lfmr = [] # LargeFiles: Mark as Removed ... and mark largefile as added
449 for action in actions['g']: 449 for action in actions['g']:
450 f, args, msg = action 450 f, args, msg = action
451 splitstandin = f and lfutil.splitstandin(f) 451 splitstandin = f and lfutil.splitstandin(f)
452 if (splitstandin is not None and 452 if (splitstandin is not None and
453 splitstandin in p1 and splitstandin not in removes): 453 splitstandin in p1 and splitstandin not in removes):
512 512
513 return actions 513 return actions
514 514
515 def mergerecordupdates(orig, repo, actions, branchmerge): 515 def mergerecordupdates(orig, repo, actions, branchmerge):
516 if 'lfmr' in actions: 516 if 'lfmr' in actions:
517 # this should be executed before 'orig', to execute 'remove' 517 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
518 # before all other actions
519 for lfile, args, msg in actions['lfmr']: 518 for lfile, args, msg in actions['lfmr']:
519 # this should be executed before 'orig', to execute 'remove'
520 # before all other actions
520 repo.dirstate.remove(lfile) 521 repo.dirstate.remove(lfile)
522 # make sure lfile doesn't get synclfdirstate'd as normal
523 lfdirstate.add(lfile)
524 lfdirstate.write()
521 525
522 return orig(repo, actions, branchmerge) 526 return orig(repo, actions, branchmerge)
523 527
524 528
525 # Override filemerge to prompt the user about how they wish to merge 529 # Override filemerge to prompt the user about how they wish to merge