changeset 38:ed1d3e3ca8e0

Add improved rev lookup to diff and export
author mpm@selenic.com
date Sat, 07 May 2005 16:13:26 -0800
parents a8811676c85a
children adf70fffca9f
files hg
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hg	Sat May 07 16:12:31 2005 -0800
+++ b/hg	Sat May 07 16:13:26 2005 -0800
@@ -159,15 +159,14 @@
     for f in d: print "R", f
 
 elif cmd == "diff":
-    doptions = {}
     revs = []
 
     if args:
+        doptions = {}
         opts = [('r', 'revision', [], 'revision')]
         args = fancyopts.fancyopts(args, opts, doptions,
                                    'hg diff [options] [files]')
-        # revs = [ repo.lookup(x) for x in doptions['revision'] ]
-        revs = [hg.bin(x) for x in doptions['revision']]
+        revs = map(lambda x: repo.changelog.lookup(x), doptions['revision'])
     
     if len(revs) > 2:
         print "too many revisions to diff"
@@ -176,7 +175,7 @@
         diff(args, *revs)
 
 elif cmd == "export":
-    node = hg.bin(args[0])
+    node = repo.changelog.lookup(args[0])
     prev = repo.changelog.parents(node)[0]
     diff(None, prev, node)