comparison 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
comparison
equal deleted inserted replaced
18850:442c0cb8287a 18851:a60963c02f92
202 @ 1:0d2164f0ce0d 202 @ 1:0d2164f0ce0d
203 * X 1:0d2164f0ce0d 203 * X 1:0d2164f0ce0d
204 Y 3:f6fc62dde3c0 204 Y 3:f6fc62dde3c0
205 Z 1:0d2164f0ce0d 205 Z 1:0d2164f0ce0d
206 206
207 update a bookmark in the middle of a client pulling changes
208
209 $ cd ..
210 $ hg clone -q a pull-race
211 $ hg clone -q pull-race pull-race2
212 $ cd pull-race
213 $ hg up -q Y
214 $ echo c4 > f2
215 $ hg ci -Am4
216 $ echo c5 > f3
217 $ cat <<EOF > .hg/hgrc
218 > [hooks]
219 > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
220 > EOF
221 $ cd ../pull-race2
222 $ hg pull
223 pulling from $TESTTMP/pull-race (glob)
224 searching for changes
225 adding changesets
226 adding f3
227 committed in pull-race
228 adding manifests
229 adding file changes
230 added 1 changesets with 1 changes to 1 files
231 updating bookmark Y
232 (run 'hg update' to get a working copy)
233 $ hg book
234 * @ 1:0d2164f0ce0d
235 X 1:0d2164f0ce0d
236 Y 4:b0a5eff05604
237 Z 1:0d2164f0ce0d
238 $ cd ../b
239
207 diverging a remote bookmark fails 240 diverging a remote bookmark fails
208 241
209 $ hg up -q 4e3505fd9583 242 $ hg up -q 4e3505fd9583
210 $ echo c4 > f2 243 $ echo c4 > f2
211 $ hg ci -Am4 244 $ hg ci -Am4