mercurial/commands.py
changeset 779 b3c7cb74d325
parent 778 d09975474928
child 783 4b06fc1c0f26
--- 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')],