##// END OF EJS Templates
large-file: use the merge action constant...
marmoute -
r49558:d536d4af default
parent child Browse files
Show More
@@ -51,6 +51,12 b' from . import ('
51 51 storefactory,
52 52 )
53 53
54 ACTION_ADD = mergestatemod.ACTION_ADD
55 ACTION_DELETED_CHANGED = mergestatemod.ACTION_DELETED_CHANGED
56 ACTION_GET = mergestatemod.ACTION_GET
57 ACTION_KEEP = mergestatemod.ACTION_KEEP
58 ACTION_REMOVE = mergestatemod.ACTION_REMOVE
59
54 60 eh = exthelper.exthelper()
55 61
56 62 lfstatus = lfutil.lfstatus
@@ -563,8 +569,9 b' def overridecalculateupdates('
563 569 standin = lfutil.standin(lfile)
564 570 (lm, largs, lmsg) = mresult.getfile(lfile, (None, None, None))
565 571 (sm, sargs, smsg) = mresult.getfile(standin, (None, None, None))
566 if sm in (b'g', b'dc') and lm != b'r':
567 if sm == b'dc':
572
573 if sm in (ACTION_GET, ACTION_DELETED_CHANGED) and lm != ACTION_REMOVE:
574 if sm == ACTION_DELETED_CHANGED:
568 575 f1, f2, fa, move, anc = sargs
569 576 sargs = (p2[f2].flags(), False)
570 577 # Case 1: normal file in the working copy, largefile in
@@ -578,26 +585,28 b' def overridecalculateupdates('
578 585 % lfile
579 586 )
580 587 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
581 mresult.addfile(lfile, b'r', None, b'replaced by standin')
582 mresult.addfile(standin, b'g', sargs, b'replaces standin')
588 mresult.addfile(
589 lfile, ACTION_REMOVE, None, b'replaced by standin'
590 )
591 mresult.addfile(standin, ACTION_GET, sargs, b'replaces standin')
583 592 else: # keep local normal file
584 mresult.addfile(lfile, b'k', None, b'replaces standin')
593 mresult.addfile(lfile, ACTION_KEEP, None, b'replaces standin')
585 594 if branchmerge:
586 595 mresult.addfile(
587 596 standin,
588 b'k',
597 ACTION_KEEP,
589 598 None,
590 599 b'replaced by non-standin',
591 600 )
592 601 else:
593 602 mresult.addfile(
594 603 standin,
595 b'r',
604 ACTION_REMOVE,
596 605 None,
597 606 b'replaced by non-standin',
598 607 )
599 elif lm in (b'g', b'dc') and sm != b'r':
600 if lm == b'dc':
608 if lm in (ACTION_GET, ACTION_DELETED_CHANGED) and sm != ACTION_REMOVE:
609 if lm == ACTION_DELETED_CHANGED:
601 610 f1, f2, fa, move, anc = largs
602 611 largs = (p2[f2].flags(), False)
603 612 # Case 2: largefile in the working copy, normal file in
@@ -615,11 +624,13 b' def overridecalculateupdates('
615 624 # largefile can be restored from standin safely
616 625 mresult.addfile(
617 626 lfile,
618 b'k',
627 ACTION_KEEP,
619 628 None,
620 629 b'replaced by standin',
621 630 )
622 mresult.addfile(standin, b'k', None, b'replaces standin')
631 mresult.addfile(
632 standin, ACTION_KEEP, None, b'replaces standin'
633 )
623 634 else:
624 635 # "lfile" should be marked as "removed" without
625 636 # removal of itself
@@ -631,12 +642,12 b' def overridecalculateupdates('
631 642 )
632 643
633 644 # linear-merge should treat this largefile as 're-added'
634 mresult.addfile(standin, b'a', None, b'keep standin')
645 mresult.addfile(standin, ACTION_ADD, None, b'keep standin')
635 646 else: # pick remote normal file
636 mresult.addfile(lfile, b'g', largs, b'replaces standin')
647 mresult.addfile(lfile, ACTION_GET, largs, b'replaces standin')
637 648 mresult.addfile(
638 649 standin,
639 b'r',
650 ACTION_REMOVE,
640 651 None,
641 652 b'replaced by non-standin',
642 653 )
General Comments 0
You need to be logged in to leave comments. Login now