hg
changeset 175 0eb6e2c9800d
parent 174 23057dc57d1b
child 188 f40273b0ad7b
--- a/hg	Thu May 26 22:54:48 2005 -0800
+++ b/hg	Thu May 26 23:39:42 2005 -0800
@@ -20,7 +20,7 @@
 from mercurial import hg, mdiff, fancyopts
 
 def help():
-    print """\
+    ui.status("""\
  commands:
 
  add [files...]        add the given files in the next commit
@@ -42,7 +42,7 @@
  status                show new, missing, and changed files in working dir
  tags                  show current changeset tags
  undo                  undo the last transaction
-"""
+""")
 
 def filterfiles(list, files):
     l = [ x for x in list if x in files ]
@@ -372,13 +372,6 @@
     for f in files:
         print hg.hex(m[f]), f
 
-elif cmd == "debugprompt":
-    print ui.prompt(args[0], args[1], args[2])
-
-elif cmd == "debughash":
-    f = repo.file(args[0])
-    print f.encodepath(args[0])
-
 elif cmd == "debugindex":
     if ".hg" not in args[0]:
         args[0] = ".hg/data/" + repo.file(args[0]).encodepath(args[0]) + "i"
@@ -412,6 +405,17 @@
         sys.exit(1)
 
     if args:
+        paths = {}
+        try:
+            pf = os.path.join(os.environ["HOME"], ".hgpaths")
+            for l in file(pf):
+                name, path = l.split()
+                paths[name] = path
+        except:
+            pass
+
+        if args[0] in paths: args[0] = paths[args[0]]
+        
         other = hg.repository(ui, args[0])
         ui.status("requesting changegroup\n")
         cg = repo.getchangegroup(other)
@@ -580,6 +584,6 @@
                  soptions["address"], soptions["port"])
     
 else:
-    print "unknown command\n"
+    if cmd: ui.warn("unknown command\n\n")
     help()
     sys.exit(1)