Patchwork [2,of,3] pull: document the race condition with bookmark name

mail settings
Submitter Pierre-Yves David
Date May 29, 2015, 10:25 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/9399/
State Accepted
Headers show


Pierre-Yves David - May 29, 2015, 10:25 p.m.
# HG changeset patch
# User Pierre-Yves David <>
# Date 1432846913 25200
#      Thu May 28 14:01:53 2015 -0700
# Node ID f9a958f8bc37c17ff8b10eee45ee51379ab90124
# Parent  8b25f0ff5c7236148eddbf4b17b37e583d495865
pull: document the race condition with bookmark name

It seems valuable to point this in-situ to help the next poor soul looking at
this code to understand what kind of beast he is currently facing.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -5121,18 +5121,25 @@  def pull(ui, repo, source="default", **o
         if opts.get('bookmark'):
             if not revs:
                 revs = []
+            # The list of bookmark used here is not the one used to actually
+            # update the bookmark name. This can result in the revision pulled
+            # to not end up with the name of the bookmark because of race
+            # condition on the server. (See issue 4689 for details)
             remotebookmarks = other.listkeys('bookmarks')
             for b in opts['bookmark']:
                 if b not in remotebookmarks:
                     raise util.Abort(_('remote bookmark %s not found!') % b)
         if revs:
+                # When 'rev' is a bookmark name, we cannot garantee that it
+                # will be updated with such name because of a race condition
+                # server side. (See issue 4689 for details)
                 revs = [other.lookup(rev) for rev in revs]
             except error.CapabilityError:
                 err = _("other repository doesn't support revision lookup, "
                         "so a rev cannot be specified.")
                 raise util.Abort(err)