##// END OF EJS Templates
debugancestor: make the index argument optional, defaulting to 00changelog.i
Bryan O'Sullivan -
r6178:81afdd01 default
parent child Browse files
Show More
@@ -568,9 +568,17 b' def copy(ui, repo, *pats, **opts):'
568 finally:
568 finally:
569 del wlock
569 del wlock
570
570
571 def debugancestor(ui, index, rev1, rev2):
571 def debugancestor(ui, *opts):
572 """find the ancestor revision of two revisions in a given index"""
572 """find the ancestor revision of two revisions in a given index"""
573 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
573 if len(opts) == 3:
574 index, rev1, rev2 = opts
575 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
576 elif len(opts) == 2:
577 rev1, rev2 = opts
578 repo = hg.repository(ui)
579 r = repo.changelog
580 else:
581 raise util.Abort(_('either two or three arguments required'))
574 a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
582 a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
575 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
583 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
576
584
@@ -2850,7 +2858,8 b' table = {'
2850 _('forcibly copy over an existing managed file')),
2858 _('forcibly copy over an existing managed file')),
2851 ] + walkopts + dryrunopts,
2859 ] + walkopts + dryrunopts,
2852 _('hg copy [OPTION]... [SOURCE]... DEST')),
2860 _('hg copy [OPTION]... [SOURCE]... DEST')),
2853 "debugancestor": (debugancestor, [], _('hg debugancestor INDEX REV1 REV2')),
2861 "debugancestor": (debugancestor, [],
2862 _('hg debugancestor [INDEX] REV1 REV2')),
2854 "debugcheckstate": (debugcheckstate, [], _('hg debugcheckstate')),
2863 "debugcheckstate": (debugcheckstate, [], _('hg debugcheckstate')),
2855 "debugcomplete":
2864 "debugcomplete":
2856 (debugcomplete,
2865 (debugcomplete,
General Comments 0
You need to be logged in to leave comments. Login now