Show More
@@ -90,7 +90,8 class Merge3Text(object): | |||||
90 | start_marker='<<<<<<<', |
|
90 | start_marker='<<<<<<<', | |
91 | mid_marker='=======', |
|
91 | mid_marker='=======', | |
92 | end_marker='>>>>>>>', |
|
92 | end_marker='>>>>>>>', | |
93 |
base_marker=None |
|
93 | base_marker=None, | |
|
94 | localorother=None): | |||
94 | """Return merge in cvs-like form. |
|
95 | """Return merge in cvs-like form. | |
95 | """ |
|
96 | """ | |
96 | self.conflicts = False |
|
97 | self.conflicts = False | |
@@ -119,6 +120,13 class Merge3Text(object): | |||||
119 | for i in range(t[1], t[2]): |
|
120 | for i in range(t[1], t[2]): | |
120 | yield self.b[i] |
|
121 | yield self.b[i] | |
121 | elif what == 'conflict': |
|
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 | self.conflicts = True |
|
130 | self.conflicts = True | |
123 | if start_marker is not None: |
|
131 | if start_marker is not None: | |
124 | yield start_marker + newline |
|
132 | yield start_marker + newline | |
@@ -390,7 +398,7 def simplemerge(ui, local, base, other, | |||||
390 | out = sys.stdout |
|
398 | out = sys.stdout | |
391 |
|
399 | |||
392 | m3 = Merge3Text(basetext, localtext, othertext) |
|
400 | m3 = Merge3Text(basetext, localtext, othertext) | |
393 | extrakwargs = {} |
|
401 | extrakwargs = {"localorother": opts.get("localorother", None)} | |
394 | if mode == 'union': |
|
402 | if mode == 'union': | |
395 | extrakwargs['start_marker'] = None |
|
403 | extrakwargs['start_marker'] = None | |
396 | extrakwargs['mid_marker'] = None |
|
404 | extrakwargs['mid_marker'] = None |
General Comments 0
You need to be logged in to leave comments.
Login now