Show More
@@ -5,7 +5,7 b' demandimport.enable()' | |||
|
5 | 5 | |
|
6 | 6 | import os, sys |
|
7 | 7 | from mercurial.i18n import _ |
|
8 | from mercurial import simplemerge, fancyopts, util | |
|
8 | from mercurial import simplemerge, fancyopts, util, ui | |
|
9 | 9 | |
|
10 | 10 | options = [('L', 'label', [], _('labels to use on conflict markers')), |
|
11 | 11 | ('a', 'text', None, _('treat all files as text')), |
@@ -55,7 +55,7 b' try:' | |||
|
55 | 55 | sys.exit(0) |
|
56 | 56 | if len(args) != 3: |
|
57 | 57 | raise ParseError(_('wrong number of arguments')) |
|
58 | sys.exit(simplemerge.simplemerge(*args, **opts)) | |
|
58 | sys.exit(simplemerge.simplemerge(ui.ui(), *args, **opts)) | |
|
59 | 59 | except ParseError, e: |
|
60 | 60 | sys.stdout.write("%s: %s\n" % (sys.argv[0], e)) |
|
61 | 61 | showhelp() |
@@ -170,7 +170,7 b' def filemerge(repo, mynode, orig, fcd, f' | |||
|
170 | 170 | |
|
171 | 171 | # do we attempt to simplemerge first? |
|
172 | 172 | if _toolbool(ui, tool, "premerge", not (binary or symlink)): |
|
173 | r = simplemerge.simplemerge(a, b, c, quiet=True) | |
|
173 | r = simplemerge.simplemerge(ui, a, b, c, quiet=True) | |
|
174 | 174 | if not r: |
|
175 | 175 | ui.debug(_(" premerge successful\n")) |
|
176 | 176 | os.unlink(back) |
@@ -187,7 +187,7 b' def filemerge(repo, mynode, orig, fcd, f' | |||
|
187 | 187 | HG_BASE_ISLINK='l' in fca.flags()) |
|
188 | 188 | |
|
189 | 189 | if tool == "internal:merge": |
|
190 | r = simplemerge.simplemerge(a, b, c, label=['local', 'other']) | |
|
190 | r = simplemerge.simplemerge(ui, a, b, c, label=['local', 'other']) | |
|
191 | 191 | else: |
|
192 | 192 | args = _toolstr(ui, tool, "args", '$local $base $other') |
|
193 | 193 | if "$output" in args: |
@@ -24,11 +24,6 b' import util, mdiff, sys, os' | |||
|
24 | 24 | class CantReprocessAndShowBase(Exception): |
|
25 | 25 | pass |
|
26 | 26 | |
|
27 | def warn(message): | |
|
28 | sys.stdout.flush() | |
|
29 | sys.stderr.write(message) | |
|
30 | sys.stderr.flush() | |
|
31 | ||
|
32 | 27 | def intersect(ra, rb): |
|
33 | 28 | """Given two ranges return the range where they intersect or None. |
|
34 | 29 | |
@@ -405,7 +400,7 b' class Merge3Text(object):' | |||
|
405 | 400 | |
|
406 | 401 | return unc |
|
407 | 402 | |
|
408 | def simplemerge(local, base, other, **opts): | |
|
403 | def simplemerge(ui, local, base, other, **opts): | |
|
409 | 404 | def readfile(filename): |
|
410 | 405 | f = open(filename, "rb") |
|
411 | 406 | text = f.read() |
@@ -415,7 +410,7 b' def simplemerge(local, base, other, **op' | |||
|
415 | 410 | if not opts.get('text'): |
|
416 | 411 | raise util.Abort(msg) |
|
417 | 412 | elif not opts.get('quiet'): |
|
418 | warn(_('warning: %s\n') % msg) | |
|
413 | ui.warn(_('warning: %s\n') % msg) | |
|
419 | 414 | return text |
|
420 | 415 | |
|
421 | 416 | name_a = local |
@@ -451,5 +446,5 b' def simplemerge(local, base, other, **op' | |||
|
451 | 446 | |
|
452 | 447 | if m3.conflicts: |
|
453 | 448 | if not opts.get('quiet'): |
|
454 | warn(_("warning: conflicts during merge.\n")) | |
|
449 | ui.warn(_("warning: conflicts during merge.\n")) | |
|
455 | 450 | return 1 |
General Comments 0
You need to be logged in to leave comments.
Login now