[PATCH] record: function variable naming & signature cleanup. No functionality change

Dan Villiom Podlaski Christiansen danchr at gmail.com
Fri Feb 5 12:09:26 CST 2010


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1265391982 -3600
# Node ID b70de774133c9d8bd8ae1dd0d05238142af03fc5
# Parent  668e3faf864779bfe2b301a80e7946366173200d
record: function variable naming & signature cleanup. No functionality change.

All tests pass.

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -381,10 +381,7 @@ def record(ui, repo, *pats, **opts):
 
       ? - display help'''
 
-    def record_committer(ui, repo, pats, opts):
-        commands.commit(ui, repo, *pats, **opts)
-
-    dorecord(ui, repo, record_committer, *pats, **opts)
+    dorecord(ui, repo, commands.commit, *pats, **opts)
 
 
 def qrecord(ui, repo, patch, *pats, **opts):
@@ -399,15 +396,15 @@ def qrecord(ui, repo, patch, *pats, **op
     except KeyError:
         raise util.Abort(_("'mq' extension not loaded"))
 
-    def qrecord_committer(ui, repo, pats, opts):
+    def committomq(ui, repo, *pats, **opts):
         mq.new(ui, repo, patch, *pats, **opts)
 
     opts = opts.copy()
     opts['force'] = True    # always 'qnew -f'
-    dorecord(ui, repo, qrecord_committer, *pats, **opts)
+    dorecord(ui, repo, committomq, *pats, **opts)
 
 
-def dorecord(ui, repo, committer, *pats, **opts):
+def dorecord(ui, repo, commitfunc, *pats, **opts):
     if not ui.interactive():
         raise util.Abort(_('running non-interactively, use commit instead'))
 
@@ -507,7 +504,7 @@ def dorecord(ui, repo, committer, *pats,
             cwd = os.getcwd()
             os.chdir(repo.root)
             try:
-                committer(ui, repo, newfiles, opts)
+                commitfunc(ui, repo, *newfiles, **opts)
             finally:
                 os.chdir(cwd)
 


More information about the Mercurial-devel mailing list