comparison mercurial/cmdutil.py @ 24358:8d9e9063b040

record: move ui.write wrapping where it should be We have to do that for the coloring to work in interactive revert
author Laurent Charignon <lcharignon@fb.com>
date Mon, 16 Mar 2015 15:37:00 -0700
parents 2da601ab3125
children 521fe8287dd5
comparison
equal deleted inserted replaced
24357:2da601ab3125 24358:8d9e9063b040
48 return patch.filterpatch(ui, originalhunks) 48 return patch.filterpatch(ui, originalhunks)
49 49
50 def recordfilter(ui, originalhunks): 50 def recordfilter(ui, originalhunks):
51 usecurses = ui.configbool('experimental', 'crecord', False) 51 usecurses = ui.configbool('experimental', 'crecord', False)
52 testfile = ui.config('experimental', 'crecordtest', None) 52 testfile = ui.config('experimental', 'crecordtest', None)
53 newchunks = filterchunks(ui, originalhunks, usecurses, testfile) 53 oldwrite = setupwrapcolorwrite(ui)
54 try:
55 newchunks = filterchunks(ui, originalhunks, usecurses, testfile)
56 finally:
57 ui.write = oldwrite
54 return newchunks 58 return newchunks
55 59
56 def dorecord(ui, repo, commitfunc, cmdsuggest, backupall, 60 def dorecord(ui, repo, commitfunc, cmdsuggest, backupall,
57 filterfn, *pats, **opts): 61 filterfn, *pats, **opts):
58 import merge as mergemod 62 import merge as mergemod
204 if tobackup: 208 if tobackup:
205 os.rmdir(backupdir) 209 os.rmdir(backupdir)
206 except OSError: 210 except OSError:
207 pass 211 pass
208 212
209 oldwrite = setupwrapcolorwrite(ui) 213 return commit(ui, repo, recordfunc, pats, opts)
210 try:
211 return commit(ui, repo, recordfunc, pats, opts)
212 finally:
213 ui.write = oldwrite
214
215 214
216 def findpossible(cmd, table, strict=False): 215 def findpossible(cmd, table, strict=False):
217 """ 216 """
218 Return cmd -> (aliases, command table entry) 217 Return cmd -> (aliases, command table entry)
219 for each matching command. 218 for each matching command.