##// END OF EJS Templates
simplemerge: enable option to resolve conflicts one way...
Jordi Gutiérrez Hermoso -
r26223:ed12abab default
parent child Browse files
Show More
@@ -90,7 +90,8 class Merge3Text(object):
90 90 start_marker='<<<<<<<',
91 91 mid_marker='=======',
92 92 end_marker='>>>>>>>',
93 base_marker=None):
93 base_marker=None,
94 localorother=None):
94 95 """Return merge in cvs-like form.
95 96 """
96 97 self.conflicts = False
@@ -119,6 +120,13 class Merge3Text(object):
119 120 for i in range(t[1], t[2]):
120 121 yield self.b[i]
121 122 elif what == 'conflict':
123 if localorother == 'local':
124 for i in range(t[3], t[4]):
125 yield self.a[i]
126 elif localorother == 'other':
127 for i in range(t[5], t[6]):
128 yield self.b[i]
129 else:
122 130 self.conflicts = True
123 131 if start_marker is not None:
124 132 yield start_marker + newline
@@ -390,7 +398,7 def simplemerge(ui, local, base, other,
390 398 out = sys.stdout
391 399
392 400 m3 = Merge3Text(basetext, localtext, othertext)
393 extrakwargs = {}
401 extrakwargs = {"localorother": opts.get("localorother", None)}
394 402 if mode == 'union':
395 403 extrakwargs['start_marker'] = None
396 404 extrakwargs['mid_marker'] = None
General Comments 0
You need to be logged in to leave comments. Login now