7 |
7 |
8 import demandimport; demandimport.enable() |
8 import demandimport; demandimport.enable() |
9 from node import * |
9 from node import * |
10 from i18n import _ |
10 from i18n import _ |
11 import os, re, sys, urllib |
11 import os, re, sys, urllib |
12 import ui, hg, util, revlog, bundlerepo, extensions |
12 import hg, util, revlog, bundlerepo, extensions |
13 import difflib, patch, time, help, mdiff, tempfile |
13 import difflib, patch, time, help, mdiff, tempfile |
14 import errno, version, socket |
14 import errno, version, socket |
15 import archival, changegroup, cmdutil, hgweb.server, sshserver |
15 import archival, changegroup, cmdutil, hgweb.server, sshserver |
16 |
16 |
17 # Commands start here, listed alphabetically |
17 # Commands start here, listed alphabetically |
660 |
660 |
661 if opts['options']: |
661 if opts['options']: |
662 options = [] |
662 options = [] |
663 otables = [globalopts] |
663 otables = [globalopts] |
664 if cmd: |
664 if cmd: |
665 aliases, entry = cmdutil.findcmd(ui, cmd) |
665 aliases, entry = cmdutil.findcmd(ui, cmd, table) |
666 otables.append(entry[1]) |
666 otables.append(entry[1]) |
667 for t in otables: |
667 for t in otables: |
668 for o in t: |
668 for o in t: |
669 if o[0]: |
669 if o[0]: |
670 options.append('-%s' % o[0]) |
670 options.append('-%s' % o[0]) |
671 options.append('--%s' % o[1]) |
671 options.append('--%s' % o[1]) |
672 ui.write("%s\n" % "\n".join(options)) |
672 ui.write("%s\n" % "\n".join(options)) |
673 return |
673 return |
674 |
674 |
675 clist = cmdutil.findpossible(ui, cmd).keys() |
675 clist = cmdutil.findpossible(ui, cmd, table).keys() |
676 clist.sort() |
676 clist.sort() |
677 ui.write("%s\n" % "\n".join(clist)) |
677 ui.write("%s\n" % "\n".join(clist)) |
678 |
678 |
679 def debugrebuildstate(ui, repo, rev=""): |
679 def debugrebuildstate(ui, repo, rev=""): |
680 """rebuild the dirstate as it would look like for the given revision""" |
680 """rebuild the dirstate as it would look like for the given revision""" |
3132 extensions.commandtable = table |
3132 extensions.commandtable = table |
3133 |
3133 |
3134 norepo = ("clone init version help debugancestor debugcomplete debugdata" |
3134 norepo = ("clone init version help debugancestor debugcomplete debugdata" |
3135 " debugindex debugindexdot debugdate debuginstall") |
3135 " debugindex debugindexdot debugdate debuginstall") |
3136 optionalrepo = ("paths serve showconfig") |
3136 optionalrepo = ("paths serve showconfig") |
3137 |
|
3138 def dispatch(args): |
|
3139 try: |
|
3140 u = ui.ui(traceback='--traceback' in args) |
|
3141 except util.Abort, inst: |
|
3142 sys.stderr.write(_("abort: %s\n") % inst) |
|
3143 return -1 |
|
3144 return cmdutil.runcatch(u, args) |
|
3145 |
|
3146 def run(): |
|
3147 sys.exit(dispatch(sys.argv[1:])) |
|