##// END OF EJS Templates
debugancestor: use repo.lookup when no revlog was specified
Alexis S. L. Carvalho -
r6253:a7e3d045 default
parent child Browse files
Show More
@@ -574,15 +574,17 b' def debugancestor(ui, repo, *args):'
574 if len(args) == 3:
574 if len(args) == 3:
575 index, rev1, rev2 = args
575 index, rev1, rev2 = args
576 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
576 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
577 lookup = r.lookup
577 elif len(args) == 2:
578 elif len(args) == 2:
578 if not repo:
579 if not repo:
579 raise util.Abort(_("There is no Mercurial repository here "
580 raise util.Abort(_("There is no Mercurial repository here "
580 "(.hg not found)"))
581 "(.hg not found)"))
581 rev1, rev2 = args
582 rev1, rev2 = args
582 r = repo.changelog
583 r = repo.changelog
584 lookup = repo.lookup
583 else:
585 else:
584 raise util.Abort(_('either two or three arguments required'))
586 raise util.Abort(_('either two or three arguments required'))
585 a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
587 a = r.ancestor(lookup(rev1), lookup(rev2))
586 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
588 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
587
589
588 def debugcomplete(ui, cmd='', **opts):
590 def debugcomplete(ui, cmd='', **opts):
General Comments 0
You need to be logged in to leave comments. Login now