4494 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) |
4494 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) |
4495 other = hg.peer(repo, opts, source) |
4495 other = hg.peer(repo, opts, source) |
4496 ui.status(_('pulling from %s\n') % util.hidepassword(source)) |
4496 ui.status(_('pulling from %s\n') % util.hidepassword(source)) |
4497 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev')) |
4497 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev')) |
4498 |
4498 |
|
4499 remotebookmarks = other.listkeys('bookmarks') |
|
4500 |
4499 if opts.get('bookmark'): |
4501 if opts.get('bookmark'): |
4500 if not revs: |
4502 if not revs: |
4501 revs = [] |
4503 revs = [] |
4502 remotebookmarks = other.listkeys('bookmarks') |
|
4503 for b in opts['bookmark']: |
4504 for b in opts['bookmark']: |
4504 if b not in remotebookmarks: |
4505 if b not in remotebookmarks: |
4505 raise util.Abort(_('remote bookmark %s not found!') % b) |
4506 raise util.Abort(_('remote bookmark %s not found!') % b) |
4506 revs.append(remotebookmarks[b]) |
4507 revs.append(remotebookmarks[b]) |
4507 |
4508 |
4512 err = _("other repository doesn't support revision lookup, " |
4513 err = _("other repository doesn't support revision lookup, " |
4513 "so a rev cannot be specified.") |
4514 "so a rev cannot be specified.") |
4514 raise util.Abort(err) |
4515 raise util.Abort(err) |
4515 |
4516 |
4516 modheads = repo.pull(other, heads=revs, force=opts.get('force')) |
4517 modheads = repo.pull(other, heads=revs, force=opts.get('force')) |
4517 bookmarks.updatefromremote(ui, repo, other, source) |
4518 bookmarks.updatefromremote(ui, repo, remotebookmarks, source) |
4518 if checkout: |
4519 if checkout: |
4519 checkout = str(repo.changelog.rev(other.lookup(checkout))) |
4520 checkout = str(repo.changelog.rev(other.lookup(checkout))) |
4520 repo._subtoppath = source |
4521 repo._subtoppath = source |
4521 try: |
4522 try: |
4522 ret = postincoming(ui, repo, modheads, opts.get('update'), checkout) |
4523 ret = postincoming(ui, repo, modheads, opts.get('update'), checkout) |