changeset 6189:81cbb5dfdec0

Make hg debugancestor accept -R by making it an optionalrepo command.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 29 Feb 2008 01:25:31 +0100
parents 3b0c2b71e0d7
children a79d9408806f
files mercurial/commands.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Feb 29 01:14:37 2008 +0100
+++ b/mercurial/commands.py	Fri Feb 29 01:25:31 2008 +0100
@@ -568,14 +568,16 @@
     finally:
         del wlock
 
-def debugancestor(ui, *args):
+def debugancestor(ui, repo, *args):
     """find the ancestor revision of two revisions in a given index"""
     if len(args) == 3:
         index, rev1, rev2 = args
         r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
     elif len(args) == 2:
+        if not repo:
+            raise util.Abort(_("There is no Mercurial repository here "
+                               "(.hg not found)"))
         rev1, rev2 = args
-        repo = hg.repository(ui)
         r = repo.changelog
     else:
         raise util.Abort(_('either two or three arguments required'))
@@ -3162,6 +3164,6 @@
     "version": (version_, [], _('hg version')),
 }
 
-norepo = ("clone init version help debugancestor debugcomplete debugdata"
+norepo = ("clone init version help debugcomplete debugdata"
           " debugindex debugindexdot debugdate debuginstall debugfsinfo")
-optionalrepo = ("identify paths serve showconfig")
+optionalrepo = ("identify paths serve showconfig debugancestor")