changeset 22021:e9801c7b6ff0

merge: refactor labels selection code The code is simplified to prepare the future introduction of a third labels for the merge base.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 09 Jun 2014 23:37:36 -0700
parents 311979b773fb
children 2ea6d906cf9b
files mercurial/filemerge.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Tue Jul 01 23:08:17 2014 +0200
+++ b/mercurial/filemerge.py	Mon Jun 09 23:37:36 2014 -0700
@@ -388,16 +388,13 @@
     ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
 
     markerstyle = ui.config('ui', 'mergemarkers', 'basic')
-    if markerstyle == 'basic':
-        formattedlabels = _defaultconflictlabels
-    else:
-        if not labels:
-            labels = _defaultconflictlabels
-
-        formattedlabels = _formatlabels(repo, fcd, fco, labels)
+    if not labels:
+        labels = _defaultconflictlabels
+    if markerstyle != 'basic':
+        labels = _formatlabels(repo, fcd, fco, labels)
 
     needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
-                        (a, b, c, back), labels=formattedlabels)
+                        (a, b, c, back), labels=labels)
     if not needcheck:
         if r:
             if onfailure: