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