mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
simplemerge: flush stdout before writing to stderr.
Besides, stderr is not always unbuffered under win32 (when redirections occur for instance), and it should be flushed too.
This commit is contained in:
parent
b4ca391b19
commit
2b6cc17dd7
@ -30,6 +30,12 @@ class CantReprocessAndShowBase(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def warn(message):
|
||||
sys.stdout.flush()
|
||||
sys.stderr.write(message)
|
||||
sys.stderr.flush()
|
||||
|
||||
|
||||
def intersect(ra, rb):
|
||||
"""Given two ranges return the range where they intersect or None.
|
||||
|
||||
@ -453,7 +459,7 @@ def simplemerge(local, base, other, **opts):
|
||||
if not opts.get('text'):
|
||||
raise util.Abort(msg)
|
||||
elif not opts.get('quiet'):
|
||||
sys.stderr.write(_('warning: %s\n') % msg)
|
||||
warn(_('warning: %s\n') % msg)
|
||||
return text
|
||||
|
||||
name_a = local
|
||||
@ -490,8 +496,7 @@ def simplemerge(local, base, other, **opts):
|
||||
|
||||
if m3.conflicts:
|
||||
if not opts.get('quiet'):
|
||||
sys.stdout.flush()
|
||||
sys.stderr.write(_("warning: conflicts during merge.\n"))
|
||||
warn(_("warning: conflicts during merge.\n"))
|
||||
return 1
|
||||
|
||||
options = [('L', 'label', [], _('labels to use on conflict markers')),
|
||||
|
Loading…
Reference in New Issue
Block a user