Patchwork [4,of,6] merge: refactor labels selection code

login
register
mail settings
Submitter Pierre-Yves David
Date June 10, 2014, 8:50 p.m.
Message ID <9282f318c729d672c05f.1402433428@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4966/
State Superseded
Commit e9801c7b6ff0cfd7578f34a4a2cb40a91dc60e14
Headers show

Comments

Pierre-Yves David - June 10, 2014, 8:50 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1402382256 25200
#      Mon Jun 09 23:37:36 2014 -0700
# Node ID 9282f318c729d672c05fd3364b8d2fce80ecac3b
# Parent  a3ebce9245b8c722f6fd7a81048db2a0f5f3177d
merge: refactor labels selection code

The code is simplified to prepare the future introduction of a third labels for
the merge base.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -380,20 +380,17 @@  def filemerge(repo, mynode, orig, fcd, f
         ui.status(_("merging %s\n") % fd)
 
     ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
 
     markerstyle = ui.config('ui', 'mergemarkers', 'detailed')
-    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:
                 ui.warn(onfailure % fd)
         else: