comparison mercurial/commands.py @ 35039:d7a4384d2d87

pull: store binary node in pullop.remotebookmarks The internal representation of bookmark value is binary. The fact we stored 'hex' was an implementation detail from using pushkey. We move the values in 'pullop.remotebookmarks' to binary before adding a way to exchange bookmarks not based on pushkey.
author Boris Feld <boris.feld@octobus.net>
date Tue, 17 Oct 2017 11:01:45 +0200
parents 6ef744a7df65
children 4b288d118d8b
comparison
equal deleted inserted replaced
35038:6ef744a7df65 35039:d7a4384d2d87
3971 # The list of bookmark used here is not the one used to actually 3971 # The list of bookmark used here is not the one used to actually
3972 # update the bookmark name. This can result in the revision pulled 3972 # update the bookmark name. This can result in the revision pulled
3973 # not ending up with the name of the bookmark because of a race 3973 # not ending up with the name of the bookmark because of a race
3974 # condition on the server. (See issue 4689 for details) 3974 # condition on the server. (See issue 4689 for details)
3975 remotebookmarks = other.listkeys('bookmarks') 3975 remotebookmarks = other.listkeys('bookmarks')
3976 remotebookmarks = bookmarks.unhexlifybookmarks(remotebookmarks)
3976 pullopargs['remotebookmarks'] = remotebookmarks 3977 pullopargs['remotebookmarks'] = remotebookmarks
3977 for b in opts['bookmark']: 3978 for b in opts['bookmark']:
3978 b = repo._bookmarks.expandname(b) 3979 b = repo._bookmarks.expandname(b)
3979 if b not in remotebookmarks: 3980 if b not in remotebookmarks:
3980 raise error.Abort(_('remote bookmark %s not found!') % b) 3981 raise error.Abort(_('remote bookmark %s not found!') % b)
3981 revs.append(remotebookmarks[b]) 3982 revs.append(hex(remotebookmarks[b]))
3982 3983
3983 if revs: 3984 if revs:
3984 try: 3985 try:
3985 # When 'rev' is a bookmark name, we cannot guarantee that it 3986 # When 'rev' is a bookmark name, we cannot guarantee that it
3986 # will be updated with that name because of a race condition 3987 # will be updated with that name because of a race condition