Patchwork [2,of,4] record: remove dependency on extensions module in dorecord

login
register
mail settings
Submitter Laurent Charignon
Date March 11, 2015, 2:24 a.m.
Message ID <e1001632d4a719089d47.1426040669@dev919.prn2.facebook.com>
Download mbox | patch
Permalink /patch/7989/
State Accepted
Headers show

Comments

Laurent Charignon - March 11, 2015, 2:24 a.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1426032220 25200
#      Tue Mar 10 17:03:40 2015 -0700
# Node ID e1001632d4a719089d475692c64a47ad516de115
# Parent  5860dbae11e639d9fcc622f68336e658fcce1330
record: remove dependency on extensions module in dorecord

Part of a serie of patches to move record from hgext to core

Patch

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -252,8 +252,12 @@ 
         label = kw.pop('label', '')
         for chunk, l in patch.difflabel(lambda: args):
             orig(chunk, label=label + l)
+
     oldwrite = ui.write
-    extensions.wrapfunction(ui, 'write', wrapwrite)
+    def wrap(*args, **kwargs):
+        return wrapwrite(oldwrite, *args, **kwargs)
+    setattr(ui, 'write', wrap)
+
     try:
         return cmdutil.commit(ui, repo, recordfunc, pats, opts)
     finally: