##// 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 b' 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,21 +120,28 b' class Merge3Text(object):'
119 120 for i in range(t[1], t[2]):
120 121 yield self.b[i]
121 122 elif what == 'conflict':
122 self.conflicts = True
123 if start_marker is not None:
124 yield start_marker + newline
125 for i in range(t[3], t[4]):
126 yield self.a[i]
127 if base_marker is not None:
128 yield base_marker + newline
129 for i in range(t[1], t[2]):
130 yield self.base[i]
131 if mid_marker is not None:
132 yield mid_marker + newline
133 for i in range(t[5], t[6]):
134 yield self.b[i]
135 if end_marker is not None:
136 yield end_marker + newline
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:
130 self.conflicts = True
131 if start_marker is not None:
132 yield start_marker + newline
133 for i in range(t[3], t[4]):
134 yield self.a[i]
135 if base_marker is not None:
136 yield base_marker + newline
137 for i in range(t[1], t[2]):
138 yield self.base[i]
139 if mid_marker is not None:
140 yield mid_marker + newline
141 for i in range(t[5], t[6]):
142 yield self.b[i]
143 if end_marker is not None:
144 yield end_marker + newline
137 145 else:
138 146 raise ValueError(what)
139 147
@@ -390,7 +398,7 b' 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