##// END OF EJS Templates
merge: if DELETED_CHANGED and GET are in actions, choose DELETED_CHANGED...
Pulkit Goyal -
r46192:ad984583 default
parent child Browse files
Show More
@@ -1220,6 +1220,21 b' def calculateupdates('
1220 repo.ui.note(_(b" %s: picking 'keep new' action\n") % f)
1220 repo.ui.note(_(b" %s: picking 'keep new' action\n") % f)
1221 mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP_NEW][0])
1221 mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP_NEW][0])
1222 continue
1222 continue
1223 # ACTION_GET and ACTION_DELETE_CHANGED are conflicting actions as
1224 # one action states the file is newer/created on remote side and
1225 # other states that file is deleted locally and changed on remote
1226 # side. Let's fallback and rely on a conflicting action to let user
1227 # do the right thing
1228 if (
1229 mergestatemod.ACTION_DELETED_CHANGED in bids
1230 and mergestatemod.ACTION_GET in bids
1231 and len(bids) == 2
1232 ):
1233 repo.ui.note(_(b" %s: picking 'delete/changed' action\n") % f)
1234 mresult.addfile(
1235 f, *bids[mergestatemod.ACTION_DELETED_CHANGED][0]
1236 )
1237 continue
1223 # If there are gets and they all agree [how could they not?], do it.
1238 # If there are gets and they all agree [how could they not?], do it.
1224 if mergestatemod.ACTION_GET in bids:
1239 if mergestatemod.ACTION_GET in bids:
1225 ga0 = bids[mergestatemod.ACTION_GET][0]
1240 ga0 = bids[mergestatemod.ACTION_GET][0]
@@ -663,14 +663,24 b' the conflict is properly detected.'
663 no merge state found
663 no merge state found
664
664
665 (merging a deletion with keeping β†’ conflict)
665 (merging a deletion with keeping β†’ conflict)
666 BROKEN: this should result in conflict
667
666
668 $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")'
667 $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")'
669 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
669
670 #if newfilenode
670 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
671 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
671 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (newfilenode !)
672 file 'the-file' was deleted in local [working copy] but was modified in other [merge rev].
672 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (old !)
673 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (old !)
674 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
675 What do you want to do? u
676 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
677 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
678 [1]
679 #else
680 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
681 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 (branch merge, don't forget to commit)
682 (branch merge, don't forget to commit)
683 #endif
674 $ ls -1
684 $ ls -1
675 other-file
685 other-file
676 the-file (newfilenode !)
686 the-file (newfilenode !)
@@ -679,7 +689,12 b' BROKEN: this should result in conflict'
679 $ hg debugmergestate
689 $ hg debugmergestate
680 local (working copy): adfd88e5d7d3d3e22bdd26512991ee64d59c1d8f
690 local (working copy): adfd88e5d7d3d3e22bdd26512991ee64d59c1d8f
681 other (merge rev): 38a4c3e7cac8c294ecb0a7a85a05464e9836ca78
691 other (merge rev): 38a4c3e7cac8c294ecb0a7a85a05464e9836ca78
682 extra: the-file (merge-removal-candidate = yes)
692 file: the-file (state "u")
693 local path: the-file (hash 0000000000000000000000000000000000000000, flags "")
694 ancestor path: the-file (node 59e363a07dc876278f0e41756236f30213b6b460)
695 other path: the-file (node 885af55420b35d7bf3bbd6f546615295bfe6544a)
696 extra: ancestorlinknode = 9b610631ab29024c5f44af7d2c19658ef8f8f071
697 extra: merge-removal-candidate = yes
683 #else
698 #else
684 $ hg debugmergestate
699 $ hg debugmergestate
685 local (working copy): adfd88e5d7d3d3e22bdd26512991ee64d59c1d8f
700 local (working copy): adfd88e5d7d3d3e22bdd26512991ee64d59c1d8f
@@ -716,14 +731,25 b' BROKEN: this should result in conflict'
716 no merge state found
731 no merge state found
717
732
718 (merging a deletion with keeping β†’ conflict)
733 (merging a deletion with keeping β†’ conflict)
719 BROKEN: this should result in conflict
720
734
721 $ hg update --clean 'desc("merge-deleting-the-file-from-updated")'
735 $ hg update --clean 'desc("merge-deleting-the-file-from-updated")'
722 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
736 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
737
738 #if newfilenode
723 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
739 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
724 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (newfilenode !)
740 file 'the-file' was deleted in local [working copy] but was modified in other [merge rev].
725 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (old !)
741 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (old !)
742 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
743 What do you want to do? u
744 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
745 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
746 [1]
747 #else
748 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
749 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
726 (branch merge, don't forget to commit)
750 (branch merge, don't forget to commit)
751 #endif
752
727 $ ls -1
753 $ ls -1
728 other-file
754 other-file
729 the-file (newfilenode !)
755 the-file (newfilenode !)
@@ -731,7 +757,12 b' BROKEN: this should result in conflict'
731 $ hg debugmergestate
757 $ hg debugmergestate
732 local (working copy): a4e0e44229dc130be2915b92c957c093f8c7ee3e
758 local (working copy): a4e0e44229dc130be2915b92c957c093f8c7ee3e
733 other (merge rev): 38a4c3e7cac8c294ecb0a7a85a05464e9836ca78
759 other (merge rev): 38a4c3e7cac8c294ecb0a7a85a05464e9836ca78
734 extra: the-file (merge-removal-candidate = yes)
760 file: the-file (state "u")
761 local path: the-file (hash 0000000000000000000000000000000000000000, flags "")
762 ancestor path: the-file (node 59e363a07dc876278f0e41756236f30213b6b460)
763 other path: the-file (node 885af55420b35d7bf3bbd6f546615295bfe6544a)
764 extra: ancestorlinknode = 9b610631ab29024c5f44af7d2c19658ef8f8f071
765 extra: merge-removal-candidate = yes
735 #else
766 #else
736 $ hg debugmergestate
767 $ hg debugmergestate
737 local (working copy): a4e0e44229dc130be2915b92c957c093f8c7ee3e
768 local (working copy): a4e0e44229dc130be2915b92c957c093f8c7ee3e
General Comments 0
You need to be logged in to leave comments. Login now