5136 if revs: |
5136 if revs: |
5137 try: |
5137 try: |
5138 # When 'rev' is a bookmark name, we cannot guarantee that it |
5138 # When 'rev' is a bookmark name, we cannot guarantee that it |
5139 # will be updated with that name because of a race condition |
5139 # will be updated with that name because of a race condition |
5140 # server side. (See issue 4689 for details) |
5140 # server side. (See issue 4689 for details) |
5141 revs = [other.lookup(rev) for rev in revs] |
5141 oldrevs = revs |
|
5142 revs = [] # actually, nodes |
|
5143 for r in oldrevs: |
|
5144 node = other.lookup(r) |
|
5145 revs.append(node) |
|
5146 if r == checkout: |
|
5147 checkout = node |
5142 except error.CapabilityError: |
5148 except error.CapabilityError: |
5143 err = _("other repository doesn't support revision lookup, " |
5149 err = _("other repository doesn't support revision lookup, " |
5144 "so a rev cannot be specified.") |
5150 "so a rev cannot be specified.") |
5145 raise util.Abort(err) |
5151 raise util.Abort(err) |
5146 |
5152 |
5147 modheads = exchange.pull(repo, other, heads=revs, |
5153 modheads = exchange.pull(repo, other, heads=revs, |
5148 force=opts.get('force'), |
5154 force=opts.get('force'), |
5149 bookmarks=opts.get('bookmark', ())).cgresult |
5155 bookmarks=opts.get('bookmark', ())).cgresult |
5150 if checkout: |
5156 if checkout: |
5151 checkout = str(repo.changelog.rev(other.lookup(checkout))) |
5157 checkout = str(repo.changelog.rev(checkout)) |
5152 repo._subtoppath = source |
5158 repo._subtoppath = source |
5153 try: |
5159 try: |
5154 ret = postincoming(ui, repo, modheads, opts.get('update'), checkout) |
5160 ret = postincoming(ui, repo, modheads, opts.get('update'), checkout) |
5155 |
5161 |
5156 finally: |
5162 finally: |