Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Path | Packages | |||
---|---|---|---|---|
M | mercurial/commands.py (21 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Valentin Gatien-Baron | Dec 16 2018, 12:26 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | valentin.gatienbaron | ||
Abandoned | valentin.gatienbaron | ||
Closed | valentin.gatienbaron |
source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) | source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) | ||||
ui.status(_('pulling from %s\n') % util.hidepassword(source)) | ui.status(_('pulling from %s\n') % util.hidepassword(source)) | ||||
other = hg.peer(repo, opts, source) | other = hg.peer(repo, opts, source) | ||||
try: | try: | ||||
revs, checkout = hg.addbranchrevs(repo, other, branches, | revs, checkout = hg.addbranchrevs(repo, other, branches, | ||||
opts.get('rev')) | opts.get('rev')) | ||||
pullopargs = {} | pullopargs = {} | ||||
if opts.get('bookmark'): | @util.cachefunc | ||||
if not revs: | def remotebookmarks(): | ||||
revs = [] | # The list of bookmark used here is the same used to actually | ||||
# The list of bookmark used here is not the one used to actually | # update the bookmark names, to avoid the race from issue 4689. | ||||
# update the bookmark name. This can result in the revision pulled | |||||
# not ending up with the name of the bookmark because of a race | |||||
# condition on the server. (See issue 4689 for details) | |||||
remotebookmarks = other.listkeys('bookmarks') | remotebookmarks = other.listkeys('bookmarks') | ||||
remotebookmarks = bookmarks.unhexlifybookmarks(remotebookmarks) | remotebookmarks = bookmarks.unhexlifybookmarks(remotebookmarks) | ||||
pullopargs['remotebookmarks'] = remotebookmarks | pullopargs['remotebookmarks'] = remotebookmarks | ||||
return remotebookmarks | |||||
if opts.get('bookmark'): | |||||
if not revs: | |||||
revs = [] | |||||
for b in opts['bookmark']: | for b in opts['bookmark']: | ||||
b = repo._bookmarks.expandname(b) | b = repo._bookmarks.expandname(b) | ||||
if b not in remotebookmarks: | if b not in remotebookmarks(): | ||||
raise error.Abort(_('remote bookmark %s not found!') % b) | raise error.Abort(_('remote bookmark %s not found!') % b) | ||||
revs.append(hex(remotebookmarks[b])) | revs.append(hex(remotebookmarks()[b])) | ||||
if revs: | if revs: | ||||
try: | try: | ||||
# When 'rev' is a bookmark name, we cannot guarantee that it | # When 'rev' is a bookmark name, we cannot guarantee that it | ||||
# will be updated with that name because of a race condition | # will be updated with that name because of a race condition | ||||
# server side. (See issue 4689 for details) | # server side. (See issue 4689 for details) | ||||
oldrevs = revs | oldrevs = revs | ||||
revs = [] # actually, nodes | revs = [] # actually, nodes |