[PATCH] record: minor clean up (qnew opts, comments)

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Dec 17 23:05:37 CST 2010


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1291781683 21600
# Node ID 1a85a494a4f91f2da677ee00d36549fe7ee15186
# Parent  aae2d5cbde647da49fb1927d02faabfc37975c63
record: minor clean up (qnew opts, comments)

* don't use --force to qnew since it's become a no-op
* rewrap comments and docstrings to 72 chars wide

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -403,11 +403,8 @@
     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, committomq, *pats, **opts)
 
-
 def dorecord(ui, repo, commitfunc, *pats, **opts):
     if not ui.interactive():
         raise util.Abort(_('running non-interactively, use commit instead'))
@@ -415,15 +412,16 @@
     def recordfunc(ui, repo, message, match, opts):
         """This is generic record driver.
 
-        Its job is to interactively filter local changes, and accordingly
-        prepare working dir into a state, where the job can be delegated to
-        non-interactive commit command such as 'commit' or 'qrefresh'.
+        Its job is to interactively filter local changes, and
+        accordingly prepare working dir into a state, where the job can
+        be delegated to non-interactive commit command such as 'commit'
+        or 'qrefresh'.
 
-        After the actual job is done by non-interactive command, working dir
-        state is restored to original.
+        After the actual job is done by non-interactive command, working
+        dir state is restored to original.
 
-        In the end we'll record interesting changes, and everything else will be
-        left in place, so the user can continue his work.
+        In the end we'll record interesting changes, and everything else
+        will be left in place, so the user can continue his work.
         """
 
         merge = len(repo[None].parents()) > 1
@@ -503,11 +501,13 @@
                     raise util.Abort(str(err))
             del fp
 
-            # 4. We prepared working directory according to filtered patch.
-            #    Now is the time to delegate the job to commit/qrefresh or the like!
+            # 4. We prepared working directory according to filtered
+            #    patch. Now is the time to delegate the job to
+            #    commit/qrefresh or the like!
 
-            # it is important to first chdir to repo root -- we'll call a
-            # highlevel command with list of pathnames relative to repo root
+            # it is important to first chdir to repo root -- we'll call
+            # a highlevel command with list of pathnames relative to
+            # repo root
             cwd = os.getcwd()
             os.chdir(repo.root)
             try:
@@ -549,11 +549,7 @@
 
 cmdtable = {
     "record":
-        (record,
-
-         # add commit options
-         commands.table['^commit|ci'][1],
-
+        (record, commands.table['^commit|ci'][1], # same options as commit
          _('hg record [OPTION]... [FILE]...')),
 }
 
@@ -566,11 +562,7 @@
 
     qcmdtable = {
     "qrecord":
-        (qrecord,
-
-         # add qnew options, except '--force'
-         [opt for opt in mq.cmdtable['^qnew'][1] if opt[1] != 'force'],
-
+        (qrecord, mq.cmdtable['^qnew'][1], # same options as qnew
          _('hg qrecord [OPTION]... PATCH [FILE]...')),
     }
 


More information about the Mercurial-devel mailing list