mercurial/simplemerge.py
changeset 22024 372ae2745acf
parent 22023 f18830651811
child 22056 83df50a8d61c
--- a/mercurial/simplemerge.py	Tue Aug 05 14:56:25 2014 -0700
+++ b/mercurial/simplemerge.py	Tue Aug 05 15:10:50 2014 -0700
@@ -379,13 +379,16 @@
 
     name_a = local
     name_b = other
+    name_base = None
     labels = opts.get('label', [])
     if len(labels) > 0:
         name_a = labels[0]
     if len(labels) > 1:
         name_b = labels[1]
     if len(labels) > 2:
-        raise util.Abort(_("can only specify two labels."))
+        name_base = labels[2]
+    if len(labels) > 3:
+        raise util.Abort(_("can only specify three labels."))
 
     try:
         localtext = readfile(local)
@@ -402,7 +405,11 @@
         out = sys.stdout
 
     m3 = Merge3Text(basetext, localtext, othertext)
-    for line in m3.merge_lines(name_a=name_a, name_b=name_b):
+    extrakwargs = {}
+    if name_base is not None:
+        extrakwargs['base_marker'] = '|||||||'
+        extrakwargs['name_base'] = name_base
+    for line in m3.merge_lines(name_a=name_a, name_b=name_b, **extrakwargs):
         out.write(line)
 
     if not opts.get('print'):