Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 6188:3b0c2b71e0d7
debugancestor: use *args instead of *opts, to not confuse with option dicts.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 29 Feb 2008 01:14:37 +0100 |
parents | 07f2236c4dee |
children | 81cbb5dfdec0 |
comparison
equal
deleted
inserted
replaced
6187:531f3e78c6f2 | 6188:3b0c2b71e0d7 |
---|---|
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)) |