[cig-commits] commit: mercurial.commands.findcmd() now takes a 'ui' in argument
Mercurial
hg at geodynamics.org
Mon Nov 24 11:26:49 PST 2008
changeset: 12:5af4dc9d62bf
user: Robin Farine <robin.farine at terminus.org>
date: Mon Oct 23 19:58:33 2006 +0200
files: forest.py
description:
mercurial.commands.findcmd() now takes a 'ui' in argument
diff -r 67b5de922489 -r 5af4dc9d62bf forest.py
--- a/forest.py Mon Oct 23 19:55:17 2006 +0200
+++ b/forest.py Mon Oct 23 19:58:33 2006 +0200
@@ -24,7 +24,7 @@ forest or to pull/push changes.
forest or to pull/push changes.
"""
-version = "0.9.1"
+version = "crew c3345b0f2fcd 20061023"
import ConfigParser
import os
@@ -33,11 +33,13 @@ from mercurial.i18n import gettext as _
from mercurial.i18n import gettext as _
from mercurial.repo import RepoError
+cmdtable = None
+
commands.norepo += " fclone"
-def cmd_options(cmd, remove=None):
- aliases, spec = commands.findcmd(cmd)
+def cmd_options(ui, cmd, remove=None):
+ aliases, spec = commands.findcmd(ui, cmd)
res = list(spec[1])
if remove is not None:
res = [opt for opt in res if opt[0] not in remove]
@@ -336,33 +338,35 @@ def trees(ui, *unused):
ui.write(root + '\n')
-cmdtable = {
- "fclone" :
- (clone,
- cmd_options('clone', remove=('r',)),
- _('hg fclone [OPTIONS] SOURCE DESTINATION')),
- "fpull" :
- (pull,
- cmd_options('pull', remove=('f', 'r')),
- _('hg fpull [OPTIONS] SNAPSHOT-FILE PATH-ALIAS')),
- "fpush" :
- (push,
- cmd_options('push', remove=('f', 'r')),
- _('hg fpush [OPTIONS] SNAPSHOT-FILE PATH-ALIAS')),
- "fseed" :
- (seed,
- [('', 'tip', None,
- _("use tip instead of revisions stored in the snapshot file"))] +
- cmd_options('clone', remove=('r',)),
- _('hg fseed [OPTIONS] SNAPSHOT-FILE PATH-ALIAS')),
- "fsnap" :
- (snapshot, [],
- 'hg fsnap [SNAPSHOT-FILE]'),
- "fstatus" :
- (status,
- cmd_options('status'),
- _('hg fstatus [OPTIONS]')),
- "ftrees" :
- (trees, [],
- 'hg ftrees'),
-}
+def uisetup(ui):
+ global cmdtable
+ cmdtable = {
+ "fclone" :
+ (clone,
+ cmd_options(ui, 'clone', remove=('r',)),
+ _('hg fclone [OPTIONS] SOURCE DESTINATION')),
+ "fpull" :
+ (pull,
+ cmd_options(ui, 'pull', remove=('f', 'r')),
+ _('hg fpull [OPTIONS] SNAPSHOT-FILE PATH-ALIAS')),
+ "fpush" :
+ (push,
+ cmd_options(ui, 'push', remove=('f', 'r')),
+ _('hg fpush [OPTIONS] SNAPSHOT-FILE PATH-ALIAS')),
+ "fseed" :
+ (seed,
+ [('', 'tip', None,
+ _("use tip instead of revisions stored in the snapshot file"))] +
+ cmd_options(ui, 'clone', remove=('r',)),
+ _('hg fseed [OPTIONS] SNAPSHOT-FILE PATH-ALIAS')),
+ "fsnap" :
+ (snapshot, [],
+ 'hg fsnap [SNAPSHOT-FILE]'),
+ "fstatus" :
+ (status,
+ cmd_options(ui, 'status'),
+ _('hg fstatus [OPTIONS]')),
+ "ftrees" :
+ (trees, [],
+ 'hg ftrees'),
+ }
More information about the CIG-COMMITS
mailing list