From patchwork Mon May 5 05:51:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [17,of,35] convert: define norepo in command decorator From: Gregory Szorc X-Patchwork-Id: 4609 Message-Id: <5c01db8906f896d651da.1399269082@vm-ubuntu-main.gateway.sonic.net> To: mercurial-devel@selenic.com Date: Sun, 04 May 2014 22:51:22 -0700 # HG changeset patch # User Gregory Szorc # Date 1399266145 25200 # Sun May 04 22:02:25 2014 -0700 # Branch stable # Node ID 5c01db8906f896d651da9bb61fcf3d440440a9f1 # Parent e82a4869a0b3f0b19a9d99ef7bb60a87d3c866e6 convert: define norepo in command decorator diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -32,17 +32,18 @@ testedwith = 'internal' ('', 'splicemap', '', _('splice synthesized history into place'), _('FILE')), ('', 'branchmap', '', _('change branch names while converting'), _('FILE')), ('', 'branchsort', None, _('try to sort changesets by branches')), ('', 'datesort', None, _('try to sort changesets by date')), ('', 'sourcesort', None, _('preserve source changesets order')), ('', 'closesort', None, _('try to reorder closed revisions'))], - _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]')) + _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]'), + norepo=True) def convert(ui, src, dest=None, revmapfile=None, **opts): """convert a foreign SCM repository to a Mercurial one. Accepted source formats [identifiers]: - Mercurial [hg] - CVS [cvs] - Darcs [darcs] @@ -298,17 +299,17 @@ def convert(ui, src, dest=None, revmapfi :convert.hg.tagsbranch: branch name for tag revisions, defaults to ``default``. :convert.hg.usebranchnames: preserve branch names. The default is True. """ return convcmd.convert(ui, src, dest, revmapfile, **opts) -@command('debugsvnlog', [], 'hg debugsvnlog') +@command('debugsvnlog', [], 'hg debugsvnlog', norepo=True) def debugsvnlog(ui, **opts): return subversion.debugsvnlog(ui, **opts) @command('debugcvsps', [ # Main options shared with cvsps-2.1 ('b', 'branches', [], _('only return changes on specified branches')), ('p', 'prefix', '', _('prefix to remove from file names')), @@ -319,32 +320,31 @@ def debugsvnlog(ui, **opts): ('z', 'fuzz', 60, _('set commit time fuzz in seconds')), ('', 'root', '', _('specify cvsroot')), # Options specific to builtin cvsps ('', 'parents', '', _('show parent changesets')), ('', 'ancestors', '', _('show current changeset in ancestor branches')), # Options that are ignored for compatibility with cvsps-2.1 ('A', 'cvs-direct', None, _('ignored for compatibility')), ], - _('hg debugcvsps [OPTION]... [PATH]...')) + _('hg debugcvsps [OPTION]... [PATH]...'), + norepo=True) def debugcvsps(ui, *args, **opts): '''create changeset information from CVS This command is intended as a debugging tool for the CVS to Mercurial converter, and can be used as a direct replacement for cvsps. Hg debugcvsps reads the CVS rlog for current directory (or any named directory) in the CVS repository, and converts the log to a series of changesets based on matching commit log entries and dates.''' return cvsps.debugcvsps(ui, *args, **opts) -commands.norepo += " convert debugsvnlog debugcvsps" - def kwconverted(ctx, name): rev = ctx.extra().get('convert_revision', '') if rev.startswith('svn:'): if name == 'svnrev': return str(subversion.revsplit(rev)[2]) elif name == 'svnpath': return subversion.revsplit(rev)[1] elif name == 'svnuuid':