changeset 6253:a7e3d0456d92

debugancestor: use repo.lookup when no revlog was specified
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 14 Mar 2008 09:56:58 -0300
parents f21f6de16d41
children 3667b6e4bbd0
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Mar 14 09:56:58 2008 -0300
+++ b/mercurial/commands.py	Fri Mar 14 09:56:58 2008 -0300
@@ -574,15 +574,17 @@
     if len(args) == 3:
         index, rev1, rev2 = args
         r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
+        lookup = r.lookup
     elif len(args) == 2:
         if not repo:
             raise util.Abort(_("There is no Mercurial repository here "
                                "(.hg not found)"))
         rev1, rev2 = args
         r = repo.changelog
+        lookup = repo.lookup
     else:
         raise util.Abort(_('either two or three arguments required'))
-    a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
+    a = r.ancestor(lookup(rev1), lookup(rev2))
     ui.write("%d:%s\n" % (r.rev(a), hex(a)))
 
 def debugcomplete(ui, cmd='', **opts):