##// END OF EJS Templates
largefiles: don't duplicate 'actions' into 'actionbyfile'
Martin von Zweigbergk -
r23642:7fd1a6c2 default
parent child Browse files
Show More
@@ -435,8 +435,7 b' def overridecalculateupdates(origfn, rep'
435
435
436 # Convert to dictionary with filename as key and action as value.
436 # Convert to dictionary with filename as key and action as value.
437 lfiles = set()
437 lfiles = set()
438 actionbyfile = actions
438 for f in actions:
439 for f in actionbyfile:
440 splitstandin = f and lfutil.splitstandin(f)
439 splitstandin = f and lfutil.splitstandin(f)
441 if splitstandin in p1:
440 if splitstandin in p1:
442 lfiles.add(splitstandin)
441 lfiles.add(splitstandin)
@@ -445,8 +444,8 b' def overridecalculateupdates(origfn, rep'
445
444
446 for lfile in lfiles:
445 for lfile in lfiles:
447 standin = lfutil.standin(lfile)
446 standin = lfutil.standin(lfile)
448 (lm, largs, lmsg) = actionbyfile.get(lfile, (None, None, None))
447 (lm, largs, lmsg) = actions.get(lfile, (None, None, None))
449 (sm, sargs, smsg) = actionbyfile.get(standin, (None, None, None))
448 (sm, sargs, smsg) = actions.get(standin, (None, None, None))
450 if sm in ('g', 'dc') and lm != 'r':
449 if sm in ('g', 'dc') and lm != 'r':
451 # Case 1: normal file in the working copy, largefile in
450 # Case 1: normal file in the working copy, largefile in
452 # the second parent
451 # the second parent
@@ -454,16 +453,14 b' def overridecalculateupdates(origfn, rep'
454 'use (l)argefile or keep (n)ormal file?'
453 'use (l)argefile or keep (n)ormal file?'
455 '$$ &Largefile $$ &Normal file') % lfile
454 '$$ &Largefile $$ &Normal file') % lfile
456 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
455 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
457 actionbyfile[lfile] = ('r', None, 'replaced by standin')
456 actions[lfile] = ('r', None, 'replaced by standin')
458 actionbyfile[standin] = ('g', sargs, 'replaces standin')
457 actions[standin] = ('g', sargs, 'replaces standin')
459 else: # keep local normal file
458 else: # keep local normal file
460 actionbyfile[lfile] = ('k', None, 'replaces standin')
459 actions[lfile] = ('k', None, 'replaces standin')
461 if branchmerge:
460 if branchmerge:
462 actionbyfile[standin] = ('k', None,
461 actions[standin] = ('k', None, 'replaced by non-standin')
463 'replaced by non-standin')
464 else:
462 else:
465 actionbyfile[standin] = ('r', None,
463 actions[standin] = ('r', None, 'replaced by non-standin')
466 'replaced by non-standin')
467 elif lm in ('g', 'dc') and sm != 'r':
464 elif lm in ('g', 'dc') and sm != 'r':
468 # Case 2: largefile in the working copy, normal file in
465 # Case 2: largefile in the working copy, normal file in
469 # the second parent
466 # the second parent
@@ -473,21 +470,21 b' def overridecalculateupdates(origfn, rep'
473 if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile
470 if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile
474 if branchmerge:
471 if branchmerge:
475 # largefile can be restored from standin safely
472 # largefile can be restored from standin safely
476 actionbyfile[lfile] = ('k', None, 'replaced by standin')
473 actions[lfile] = ('k', None, 'replaced by standin')
477 actionbyfile[standin] = ('k', None, 'replaces standin')
474 actions[standin] = ('k', None, 'replaces standin')
478 else:
475 else:
479 # "lfile" should be marked as "removed" without
476 # "lfile" should be marked as "removed" without
480 # removal of itself
477 # removal of itself
481 actionbyfile[lfile] = ('lfmr', None,
478 actions[lfile] = ('lfmr', None,
482 'forget non-standin largefile')
479 'forget non-standin largefile')
483
480
484 # linear-merge should treat this largefile as 're-added'
481 # linear-merge should treat this largefile as 're-added'
485 actionbyfile[standin] = ('a', None, 'keep standin')
482 actions[standin] = ('a', None, 'keep standin')
486 else: # pick remote normal file
483 else: # pick remote normal file
487 actionbyfile[lfile] = ('g', largs, 'replaces standin')
484 actions[lfile] = ('g', largs, 'replaces standin')
488 actionbyfile[standin] = ('r', None, 'replaced by non-standin')
485 actions[standin] = ('r', None, 'replaced by non-standin')
489
486
490 return actionbyfile, diverge, renamedelete
487 return actions, diverge, renamedelete
491
488
492 def mergerecordupdates(orig, repo, actions, branchmerge):
489 def mergerecordupdates(orig, repo, actions, branchmerge):
493 if 'lfmr' in actions:
490 if 'lfmr' in actions:
General Comments 0
You need to be logged in to leave comments. Login now