From patchwork Mon May 5 05:51:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [35,of,35] record: define inferrepo in command decorator From: Gregory Szorc X-Patchwork-Id: 4626 Message-Id: <37de367b676d168e3140.1399269100@vm-ubuntu-main.gateway.sonic.net> To: mercurial-devel@selenic.com Date: Sun, 04 May 2014 22:51:40 -0700 # HG changeset patch # User Gregory Szorc # Date 1399268167 25200 # Sun May 04 22:36:07 2014 -0700 # Branch stable # Node ID 37de367b676d168e3140fbe5dc4c51c5774f6c8a # Parent 39951943062ce591b534e83d1e4c8dcac9a6f135 record: define inferrepo in command decorator 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"