##// END OF EJS Templates
bookmarks: when @ bookmark diverges, don't double the @ sign (BC)...
David M. Carr -
r17770:6c81b8eb default
parent child Browse files
Show More
@@ -214,16 +214,20 b' def updatefromremote(ui, repo, remote, p'
214 214 changed = True
215 215 ui.status(_("updating bookmark %s\n") % k)
216 216 else:
217 if k == '@':
218 kd = ''
219 else:
220 kd = k
217 221 # find a unique @ suffix
218 222 for x in range(1, 100):
219 n = '%s@%d' % (k, x)
223 n = '%s@%d' % (kd, x)
220 224 if n not in repo._bookmarks:
221 225 break
222 226 # try to use an @pathalias suffix
223 227 # if an @pathalias already exists, we overwrite (update) it
224 228 for p, u in ui.configitems("paths"):
225 229 if path == u:
226 n = '%s@%s' % (k, p)
230 n = '%s@%s' % (kd, p)
227 231
228 232 repo._bookmarks[n] = cr.node()
229 233 changed = True
@@ -111,8 +111,10 b' divergent bookmarks'
111 111 $ echo c1 > f1
112 112 $ hg ci -Am1
113 113 adding f1
114 $ hg book -f @
114 115 $ hg book -f X
115 116 $ hg book
117 @ 1:0d2164f0ce0d
116 118 * X 1:0d2164f0ce0d
117 119 Y 0:4e3505fd9583
118 120 Z 1:0d2164f0ce0d
@@ -124,8 +126,10 b' divergent bookmarks'
124 126 $ echo c2 > f2
125 127 $ hg ci -Am2
126 128 adding f2
129 $ hg book -f @
127 130 $ hg book -f X
128 131 $ hg book
132 @ 1:9b140be10808
129 133 * X 1:9b140be10808
130 134 Y 0:4e3505fd9583
131 135 Z 0:4e3505fd9583
@@ -141,8 +145,11 b' divergent bookmarks'
141 145 added 1 changesets with 1 changes to 1 files (+1 heads)
142 146 divergent bookmark X stored as X@foo
143 147 updating bookmark Z
148 divergent bookmark @ stored as @foo
144 149 (run 'hg heads' to see heads, 'hg merge' to merge)
145 150 $ hg book
151 @ 1:9b140be10808
152 @foo 2:0d2164f0ce0d
146 153 * X 1:9b140be10808
147 154 X@foo 2:0d2164f0ce0d
148 155 Y 0:4e3505fd9583
@@ -157,6 +164,7 b' divergent bookmarks'
157 164 adding file changes
158 165 added 1 changesets with 1 changes to 1 files (+1 heads)
159 166 $ hg -R ../a book
167 @ 1:0d2164f0ce0d
160 168 * X 1:0d2164f0ce0d
161 169 Y 0:4e3505fd9583
162 170 Z 1:0d2164f0ce0d
@@ -177,6 +185,7 b' update a remote bookmark from a non-head'
177 185 added 1 changesets with 1 changes to 1 files (+1 heads)
178 186 updating bookmark Y
179 187 $ hg -R ../a book
188 @ 1:0d2164f0ce0d
180 189 * X 1:0d2164f0ce0d
181 190 Y 3:f6fc62dde3c0
182 191 Z 1:0d2164f0ce0d
@@ -206,6 +215,7 b' diverging a remote bookmark fails'
206 215 (did you forget to merge? use push -f to force)
207 216 [255]
208 217 $ hg -R ../a book
218 @ 1:0d2164f0ce0d
209 219 * X 1:0d2164f0ce0d
210 220 Y 3:f6fc62dde3c0
211 221 Z 1:0d2164f0ce0d
@@ -221,6 +231,7 b' Unrelated marker does not alter the deci'
221 231 (did you forget to merge? use push -f to force)
222 232 [255]
223 233 $ hg -R ../a book
234 @ 1:0d2164f0ce0d
224 235 * X 1:0d2164f0ce0d
225 236 Y 3:f6fc62dde3c0
226 237 Z 1:0d2164f0ce0d
@@ -241,6 +252,7 b' Update to a successor works'
241 252 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
242 253 updating bookmark Y
243 254 $ hg -R ../a book
255 @ 1:0d2164f0ce0d
244 256 * X 1:0d2164f0ce0d
245 257 Y 4:4efff6d98829
246 258 Z 1:0d2164f0ce0d
@@ -263,11 +275,12 b' hgweb'
263 275 namespaces
264 276 obsolete
265 277 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
278 @ 9b140be1080824d768c5a4691a564088eede71f9
279 foo 0000000000000000000000000000000000000000
280 foobar 9b140be1080824d768c5a4691a564088eede71f9
266 281 Y 4efff6d98829d9c824c621afd6e3f01865f5439f
267 foobar 9b140be1080824d768c5a4691a564088eede71f9
282 X 9b140be1080824d768c5a4691a564088eede71f9
268 283 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
269 foo 0000000000000000000000000000000000000000
270 X 9b140be1080824d768c5a4691a564088eede71f9
271 284 $ hg out -B http://localhost:$HGPORT/
272 285 comparing with http://localhost:$HGPORT/
273 286 searching for changed bookmarks
@@ -289,10 +302,11 b' hgweb'
289 302 $ hg pull -B Z http://localhost:$HGPORT/
290 303 pulling from http://localhost:$HGPORT/
291 304 no changes found
305 divergent bookmark @ stored as @1
306 adding remote bookmark foo
292 307 adding remote bookmark foobar
308 divergent bookmark X stored as X@1
293 309 adding remote bookmark Z
294 adding remote bookmark foo
295 divergent bookmark X stored as X@1
296 310 importing bookmark Z
297 311 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
298 312 requesting all changes
@@ -303,6 +317,7 b' hgweb'
303 317 updating to branch default
304 318 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 319 $ hg -R cloned-bookmarks bookmarks
320 @ 1:9b140be10808
306 321 X 1:9b140be10808
307 322 Y 3:4efff6d98829
308 323 Z 2:0d2164f0ce0d
General Comments 0
You need to be logged in to leave comments. Login now