1782 ui.status(_('comparing with %s\n') % util.hidepassword(remoteurl)) |
1782 ui.status(_('comparing with %s\n') % util.hidepassword(remoteurl)) |
1783 |
1783 |
1784 # make sure tests are repeatable |
1784 # make sure tests are repeatable |
1785 random.seed(12323) |
1785 random.seed(12323) |
1786 |
1786 |
1787 def doit(localheads, remoteheads): |
1787 def doit(localheads, remoteheads, remote=remote): |
1788 if opts.get('old'): |
1788 if opts.get('old'): |
1789 if localheads: |
1789 if localheads: |
1790 raise util.Abort('cannot use localheads with old style ' |
1790 raise util.Abort('cannot use localheads with old style ' |
1791 'discovery') |
1791 'discovery') |
1792 common, _in, hds = treediscovery.findcommonincoming(repo, remote, |
1792 common, _in, hds = treediscovery.findcommonincoming(repo, remote, |
3461 output = [] |
3461 output = [] |
3462 revs = [] |
3462 revs = [] |
3463 |
3463 |
3464 if source: |
3464 if source: |
3465 source, branches = hg.parseurl(ui.expandpath(source)) |
3465 source, branches = hg.parseurl(ui.expandpath(source)) |
3466 repo = hg.peer(ui, opts, source) |
3466 peer = hg.peer(ui, opts, source) |
3467 revs, checkout = hg.addbranchrevs(repo, repo, branches, None) |
3467 repo = peer.local() |
3468 |
3468 revs, checkout = hg.addbranchrevs(repo, peer, branches, None) |
3469 if not repo.local(): |
3469 |
|
3470 if not repo: |
3470 if num or branch or tags: |
3471 if num or branch or tags: |
3471 raise util.Abort( |
3472 raise util.Abort( |
3472 _("can't query remote revision number, branch, or tags")) |
3473 _("can't query remote revision number, branch, or tags")) |
3473 if not rev and revs: |
3474 if not rev and revs: |
3474 rev = revs[0] |
3475 rev = revs[0] |
3475 if not rev: |
3476 if not rev: |
3476 rev = "tip" |
3477 rev = "tip" |
3477 |
3478 |
3478 remoterev = repo.lookup(rev) |
3479 remoterev = peer.lookup(rev) |
3479 if default or id: |
3480 if default or id: |
3480 output = [hexfunc(remoterev)] |
3481 output = [hexfunc(remoterev)] |
3481 |
3482 |
3482 def getbms(): |
3483 def getbms(): |
3483 bms = [] |
3484 bms = [] |
3484 |
3485 |
3485 if 'bookmarks' in repo.listkeys('namespaces'): |
3486 if 'bookmarks' in peer.listkeys('namespaces'): |
3486 hexremoterev = hex(remoterev) |
3487 hexremoterev = hex(remoterev) |
3487 bms = [bm for bm, bmr in repo.listkeys('bookmarks').iteritems() |
3488 bms = [bm for bm, bmr in peer.listkeys('bookmarks').iteritems() |
3488 if bmr == hexremoterev] |
3489 if bmr == hexremoterev] |
3489 |
3490 |
3490 return bms |
3491 return bms |
3491 |
3492 |
3492 if bookmarks: |
3493 if bookmarks: |