record: move ui.write wrapping where it should be
We have to do that for the coloring to work in interactive revert
--- a/mercurial/cmdutil.py Mon Mar 16 15:35:50 2015 -0700
+++ b/mercurial/cmdutil.py Mon Mar 16 15:37:00 2015 -0700
@@ -50,7 +50,11 @@
def recordfilter(ui, originalhunks):
usecurses = ui.configbool('experimental', 'crecord', False)
testfile = ui.config('experimental', 'crecordtest', None)
- newchunks = filterchunks(ui, originalhunks, usecurses, testfile)
+ oldwrite = setupwrapcolorwrite(ui)
+ try:
+ newchunks = filterchunks(ui, originalhunks, usecurses, testfile)
+ finally:
+ ui.write = oldwrite
return newchunks
def dorecord(ui, repo, commitfunc, cmdsuggest, backupall,
@@ -206,12 +210,7 @@
except OSError:
pass
- oldwrite = setupwrapcolorwrite(ui)
- try:
- return commit(ui, repo, recordfunc, pats, opts)
- finally:
- ui.write = oldwrite
-
+ return commit(ui, repo, recordfunc, pats, opts)
def findpossible(cmd, table, strict=False):
"""