Show More
@@ -169,7 +169,7 b' def _ifail(repo, mynode, orig, fcd, fco,' | |||||
169 | used to resolve these conflicts.""" |
|
169 | used to resolve these conflicts.""" | |
170 | return 1 |
|
170 | return 1 | |
171 |
|
171 | |||
172 | def _premerge(repo, toolconf, files): |
|
172 | def _premerge(repo, toolconf, files, labels=None): | |
173 | tool, toolpath, binary, symlink = toolconf |
|
173 | tool, toolpath, binary, symlink = toolconf | |
174 | if symlink: |
|
174 | if symlink: | |
175 | return 1 |
|
175 | return 1 | |
@@ -190,7 +190,7 b' def _premerge(repo, toolconf, files):' | |||||
190 | (tool, premerge, _valid)) |
|
190 | (tool, premerge, _valid)) | |
191 |
|
191 | |||
192 | if premerge: |
|
192 | if premerge: | |
193 | r = simplemerge.simplemerge(ui, a, b, c, quiet=True) |
|
193 | r = simplemerge.simplemerge(ui, a, b, c, quiet=True, label=labels) | |
194 | if not r: |
|
194 | if not r: | |
195 | ui.debug(" premerge successful\n") |
|
195 | ui.debug(" premerge successful\n") | |
196 | return 0 |
|
196 | return 0 | |
@@ -201,7 +201,7 b' def _premerge(repo, toolconf, files):' | |||||
201 | @internaltool('merge', True, |
|
201 | @internaltool('merge', True, | |
202 | _("merging %s incomplete! " |
|
202 | _("merging %s incomplete! " | |
203 | "(edit conflicts, then use 'hg resolve --mark')\n")) |
|
203 | "(edit conflicts, then use 'hg resolve --mark')\n")) | |
204 | def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files): |
|
204 | def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): | |
205 | """ |
|
205 | """ | |
206 | Uses the internal non-interactive simple merge algorithm for merging |
|
206 | Uses the internal non-interactive simple merge algorithm for merging | |
207 | files. It will fail if there are any conflicts and leave markers in |
|
207 | files. It will fail if there are any conflicts and leave markers in | |
@@ -211,19 +211,18 b' def _imerge(repo, mynode, orig, fcd, fco' | |||||
211 | repo.ui.warn(_('warning: internal:merge cannot merge symlinks ' |
|
211 | repo.ui.warn(_('warning: internal:merge cannot merge symlinks ' | |
212 | 'for %s\n') % fcd.path()) |
|
212 | 'for %s\n') % fcd.path()) | |
213 | return False, 1 |
|
213 | return False, 1 | |
214 |
|
214 | r = _premerge(repo, toolconf, files, labels=labels) | ||
215 | r = _premerge(repo, toolconf, files) |
|
|||
216 | if r: |
|
215 | if r: | |
217 | a, b, c, back = files |
|
216 | a, b, c, back = files | |
218 |
|
217 | |||
219 | ui = repo.ui |
|
218 | ui = repo.ui | |
220 |
|
219 | |||
221 |
r = simplemerge.simplemerge(ui, a, b, c, label= |
|
220 | r = simplemerge.simplemerge(ui, a, b, c, label=labels) | |
222 | return True, r |
|
221 | return True, r | |
223 | return False, 0 |
|
222 | return False, 0 | |
224 |
|
223 | |||
225 | @internaltool('dump', True) |
|
224 | @internaltool('dump', True) | |
226 | def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files): |
|
225 | def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): | |
227 | """ |
|
226 | """ | |
228 | Creates three versions of the files to merge, containing the |
|
227 | Creates three versions of the files to merge, containing the | |
229 | contents of local, other and base. These files can then be used to |
|
228 | contents of local, other and base. These files can then be used to | |
@@ -231,7 +230,7 b' def _idump(repo, mynode, orig, fcd, fco,' | |||||
231 | ``a.txt``, these files will accordingly be named ``a.txt.local``, |
|
230 | ``a.txt``, these files will accordingly be named ``a.txt.local``, | |
232 | ``a.txt.other`` and ``a.txt.base`` and they will be placed in the |
|
231 | ``a.txt.other`` and ``a.txt.base`` and they will be placed in the | |
233 | same directory as ``a.txt``.""" |
|
232 | same directory as ``a.txt``.""" | |
234 | r = _premerge(repo, toolconf, files) |
|
233 | r = _premerge(repo, toolconf, files, labels=labels) | |
235 | if r: |
|
234 | if r: | |
236 | a, b, c, back = files |
|
235 | a, b, c, back = files | |
237 |
|
236 | |||
@@ -242,8 +241,8 b' def _idump(repo, mynode, orig, fcd, fco,' | |||||
242 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) |
|
241 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) | |
243 | return False, r |
|
242 | return False, r | |
244 |
|
243 | |||
245 | def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files): |
|
244 | def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): | |
246 | r = _premerge(repo, toolconf, files) |
|
245 | r = _premerge(repo, toolconf, files, labels=labels) | |
247 | if r: |
|
246 | if r: | |
248 | tool, toolpath, binary, symlink = toolconf |
|
247 | tool, toolpath, binary, symlink = toolconf | |
249 | a, b, c, back = files |
|
248 | a, b, c, back = files | |
@@ -327,8 +326,9 b' def filemerge(repo, mynode, orig, fcd, f' | |||||
327 |
|
326 | |||
328 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) |
|
327 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) | |
329 |
|
328 | |||
|
329 | labels = ['local', 'other'] | |||
330 | needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
330 | needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf, | |
331 | (a, b, c, back)) |
|
331 | (a, b, c, back), labels=labels) | |
332 | if not needcheck: |
|
332 | if not needcheck: | |
333 | if r: |
|
333 | if r: | |
334 | if onfailure: |
|
334 | if onfailure: |
General Comments 0
You need to be logged in to leave comments.
Login now