# HG changeset patch # User TK Soh # Date 1122481199 28800 # Node ID b3c7cb74d32589ae885e7554cf56404df6edc1d7 # Parent d099754749284e0a096c79c0407b3ef344fb2831 Add paths command The following patch adds the 'paths' commands to show a named path, or list of available paths. In case anyone find it useful. diff -r d09975474928 -r b3c7cb74d325 mercurial/commands.py --- a/mercurial/commands.py Wed Jul 27 08:14:52 2005 -0800 +++ b/mercurial/commands.py Wed Jul 27 08:19:59 2005 -0800 @@ -777,6 +777,19 @@ if n != hg.nullid: show_changeset(ui, repo, changenode=n) +def paths(ui, repo, search = None): + """show path or list of available paths""" + if search: + for name, path in ui.configitems("paths"): + if name == search: + ui.write("%s\n" % path) + return + ui.warn("not found!\n") + return 1 + else: + for name, path in ui.configitems("paths"): + ui.write("%s = %s\n" % (name, path)) + def pull(ui, repo, source="default", **opts): """pull changes from the specified source""" source = ui.expandpath(source) @@ -1165,6 +1178,7 @@ 'hg log [-r REV1 [-r REV2]] [-p] [FILE]'), "manifest": (manifest, [], 'hg manifest [REV]'), "parents": (parents, [], 'hg parents [REV]'), + "paths": (paths, [], 'hg paths [name]'), "^pull": (pull, [('u', 'update', None, 'update working directory')],