Patchwork [35,of,35] record: define inferrepo in command decorator

login
register
mail settings
Submitter Gregory Szorc
Date May 5, 2014, 5:51 a.m.
Message ID <37de367b676d168e3140.1399269100@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/4626/
State Accepted
Commit fb5f34bb3867c8ebf9f3288236300c7a1fceee59
Headers show

Comments

Gregory Szorc - May 5, 2014, 5:51 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1399268167 25200
#      Sun May 04 22:36:07 2014 -0700
# Branch stable
# Node ID 37de367b676d168e3140fbe5dc4c51c5774f6c8a
# Parent  39951943062ce591b534e83d1e4c8dcac9a6f135
record: define inferrepo in command decorator

Patch

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -455,17 +455,20 @@  def qrefresh(origfn, ui, repo, *pats, **
         # We can't pass *pats here since qrefresh will undo all other
         # changed files in the patch that aren't in pats.
         mq.refresh(ui, repo, **opts)
 
     # backup all changed files
     dorecord(ui, repo, committomq, 'qrefresh', True, *pats, **opts)
 
 # This command registration is replaced during uisetup().
-@command('qrecord', [], _('hg qrecord [OPTION]... PATCH [FILE]...'))
+@command('qrecord',
+    [],
+    _('hg qrecord [OPTION]... PATCH [FILE]...'),
+    inferrepo=True)
 def qrecord(ui, repo, patch, *pats, **opts):
     '''interactively record a new patch
 
     See :hg:`help qnew` & :hg:`help record` for more information and
     usage.
     '''
 
     try:
@@ -654,10 +657,8 @@  def uisetup(ui):
 
     _wrapcmd('qnew', mq.cmdtable, qnew, _("interactively record a new patch"))
     _wrapcmd('qrefresh', mq.cmdtable, qrefresh,
              _("interactively select changes to refresh"))
 
 def _wrapcmd(cmd, table, wrapfn, msg):
     entry = extensions.wrapcommand(table, cmd, wrapfn)
     entry[1].append(('i', 'interactive', None, msg))
-
-commands.inferrepo += " record qrecord"