equal
deleted
inserted
replaced
566 try: |
566 try: |
567 return cmdutil.copy(ui, repo, pats, opts) |
567 return cmdutil.copy(ui, repo, pats, opts) |
568 finally: |
568 finally: |
569 del wlock |
569 del wlock |
570 |
570 |
571 def debugancestor(ui, *opts): |
571 def debugancestor(ui, *args): |
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 if len(opts) == 3: |
573 if len(args) == 3: |
574 index, rev1, rev2 = opts |
574 index, rev1, rev2 = args |
575 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index) |
575 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index) |
576 elif len(opts) == 2: |
576 elif len(args) == 2: |
577 rev1, rev2 = opts |
577 rev1, rev2 = args |
578 repo = hg.repository(ui) |
578 repo = hg.repository(ui) |
579 r = repo.changelog |
579 r = repo.changelog |
580 else: |
580 else: |
581 raise util.Abort(_('either two or three arguments required')) |
581 raise util.Abort(_('either two or three arguments required')) |
582 a = r.ancestor(r.lookup(rev1), r.lookup(rev2)) |
582 a = r.ancestor(r.lookup(rev1), r.lookup(rev2)) |