Mercurial > hg
comparison hgext/record.py @ 24270:c256ae48fd26
record: remove dependency on extensions module in dorecord
Part of a series of patches to move record from hgext to core
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Tue, 10 Mar 2015 17:03:40 -0700 |
parents | 9a745ced79a9 |
children | 18792f2e38bb |
comparison
equal
deleted
inserted
replaced
24269:9a745ced79a9 | 24270:c256ae48fd26 |
---|---|
251 def wrapwrite(orig, *args, **kw): | 251 def wrapwrite(orig, *args, **kw): |
252 label = kw.pop('label', '') | 252 label = kw.pop('label', '') |
253 for chunk, l in patch.difflabel(lambda: args): | 253 for chunk, l in patch.difflabel(lambda: args): |
254 orig(chunk, label=label + l) | 254 orig(chunk, label=label + l) |
255 oldwrite = ui.write | 255 oldwrite = ui.write |
256 extensions.wrapfunction(ui, 'write', wrapwrite) | 256 |
257 def wrap(*args, **kwargs): | |
258 return wrapwrite(oldwrite, *args, **kwargs) | |
259 setattr(ui, 'write', wrap) | |
260 | |
257 try: | 261 try: |
258 return cmdutil.commit(ui, repo, recordfunc, pats, opts) | 262 return cmdutil.commit(ui, repo, recordfunc, pats, opts) |
259 finally: | 263 finally: |
260 ui.write = oldwrite | 264 ui.write = oldwrite |
261 | 265 |