##// END OF EJS Templates
merge: introduce hasconflicts() on mergeresult object...
Pulkit Goyal -
r45835:0c849f01 default
parent child Browse files
Show More
@@ -581,6 +581,21 b' class mergeresult(object):'
581 def setactions(self, actions):
581 def setactions(self, actions):
582 self._actions = actions
582 self._actions = actions
583
583
584 def hasconflicts(self):
585 """ tells whether this merge resulted in some actions which can
586 result in conflicts or not """
587 for _f, (m, _unused, _unused) in pycompat.iteritems(self._actions):
588 if m not in (
589 mergestatemod.ACTION_GET,
590 mergestatemod.ACTION_KEEP,
591 mergestatemod.ACTION_EXEC,
592 mergestatemod.ACTION_REMOVE,
593 mergestatemod.ACTION_PATH_CONFLICT_RESOLVE,
594 ):
595 return True
596
597 return False
598
584
599
585 def manifestmerge(
600 def manifestmerge(
586 repo,
601 repo,
@@ -1809,17 +1824,10 b' def update('
1809 actionbyfile = mresult.actions
1824 actionbyfile = mresult.actions
1810
1825
1811 if updatecheck == UPDATECHECK_NO_CONFLICT:
1826 if updatecheck == UPDATECHECK_NO_CONFLICT:
1812 for f, (m, args, msg) in pycompat.iteritems(actionbyfile):
1827 if mresult.hasconflicts():
1813 if m not in (
1828 msg = _(b"conflicting changes")
1814 mergestatemod.ACTION_GET,
1829 hint = _(b"commit or update --clean to discard changes")
1815 mergestatemod.ACTION_KEEP,
1830 raise error.Abort(msg, hint=hint)
1816 mergestatemod.ACTION_EXEC,
1817 mergestatemod.ACTION_REMOVE,
1818 mergestatemod.ACTION_PATH_CONFLICT_RESOLVE,
1819 ):
1820 msg = _(b"conflicting changes")
1821 hint = _(b"commit or update --clean to discard changes")
1822 raise error.Abort(msg, hint=hint)
1823
1831
1824 # Prompt and create actions. Most of this is in the resolve phase
1832 # Prompt and create actions. Most of this is in the resolve phase
1825 # already, but we can't handle .hgsubstate in filemerge or
1833 # already, but we can't handle .hgsubstate in filemerge or
General Comments 0
You need to be logged in to leave comments. Login now