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