Mercurial > public > mercurial-scm > hg
diff tests/test-bookmarks-pushpull.t @ 18851:a60963c02f92
pull: list bookmarks before pulling changesets (issue3873)
Consider a bookmark B that exists both locally and remotely. If B is updated
remotely, and then a pull is performed where the pull set contains the new
location of B, the bookmark is updated locally. However, if remote B is
updated in the middle of a pull to a location not in the pull set, the
bookmark won't be updated locally at all.
To fix this, list bookmarks before pulling in changesets, not after. This
still leaves a race open if B gets moved in between listing bookmarks and
pulling in changesets, but the race window is much smaller. Fixing the race
properly would require a bundle format upgrade.
test-hook.t's output changes because we no longer do two listkeys calls during
pull, just one.
test-pull-http.t's output changes because we now search for bookmarks before
searching for changes.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 29 Mar 2013 19:54:06 -0700 |
parents | 8260fa9f30b9 |
children | 14c91b18d798 |
line wrap: on
line diff
--- a/tests/test-bookmarks-pushpull.t Fri Mar 29 19:52:02 2013 -0700 +++ b/tests/test-bookmarks-pushpull.t Fri Mar 29 19:54:06 2013 -0700 @@ -204,6 +204,39 @@ Y 3:f6fc62dde3c0 Z 1:0d2164f0ce0d +update a bookmark in the middle of a client pulling changes + + $ cd .. + $ hg clone -q a pull-race + $ hg clone -q pull-race pull-race2 + $ cd pull-race + $ hg up -q Y + $ echo c4 > f2 + $ hg ci -Am4 + $ echo c5 > f3 + $ cat <<EOF > .hg/hgrc + > [hooks] + > outgoing.makecommit = hg ci -Am5; echo committed in pull-race + > EOF + $ cd ../pull-race2 + $ hg pull + pulling from $TESTTMP/pull-race (glob) + searching for changes + adding changesets + adding f3 + committed in pull-race + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + updating bookmark Y + (run 'hg update' to get a working copy) + $ hg book + * @ 1:0d2164f0ce0d + X 1:0d2164f0ce0d + Y 4:b0a5eff05604 + Z 1:0d2164f0ce0d + $ cd ../b + diverging a remote bookmark fails $ hg up -q 4e3505fd9583