# HG changeset patch # User mpm@selenic.com # Date 1117179582 28800 # Node ID 0eb6e2c9800dacff5a24ade97510ce6512b322fc # Parent 23057dc57d1b01b06897e8d89bd6fe81b12c849c hg: remove some debug commands, improve help messages, add .hgpaths file .hgpaths is a file with lines of the form: that allows you to do: hg merge diff -r 23057dc57d1b -r 0eb6e2c9800d hg --- 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)