Show More
@@ -568,9 +568,17 b' def copy(ui, repo, *pats, **opts):' | |||
|
568 | 568 | finally: |
|
569 | 569 | del wlock |
|
570 | 570 | |
|
571 |
def debugancestor(ui, |
|
|
571 | def debugancestor(ui, *opts): | |
|
572 | 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 | 582 | a = r.ancestor(r.lookup(rev1), r.lookup(rev2)) |
|
575 | 583 | ui.write("%d:%s\n" % (r.rev(a), hex(a))) |
|
576 | 584 | |
@@ -2850,7 +2858,8 b' table = {' | |||
|
2850 | 2858 | _('forcibly copy over an existing managed file')), |
|
2851 | 2859 | ] + walkopts + dryrunopts, |
|
2852 | 2860 | _('hg copy [OPTION]... [SOURCE]... DEST')), |
|
2853 |
"debugancestor": (debugancestor, [], |
|
|
2861 | "debugancestor": (debugancestor, [], | |
|
2862 | _('hg debugancestor [INDEX] REV1 REV2')), | |
|
2854 | 2863 | "debugcheckstate": (debugcheckstate, [], _('hg debugcheckstate')), |
|
2855 | 2864 | "debugcomplete": |
|
2856 | 2865 | (debugcomplete, |
General Comments 0
You need to be logged in to leave comments.
Login now