##// END OF EJS Templates
bookmarks: don't use bookmarks.listbookmarks in local computations...
Kevin Bullock -
r18495:8260fa9f stable
parent child Browse files
Show More
@@ -9,7 +9,7 b''
9 9 import copy
10 10 import phases
11 11 import util
12 import obsolete, bookmarks, revset
12 import obsolete, revset
13 13
14 14
15 15 def hideablerevs(repo):
@@ -32,7 +32,7 b' def computehidden(repo):'
32 32 if r not in hideable]
33 33 for par in repo[None].parents():
34 34 blockers.append(par.rev())
35 for bm in bookmarks.listbookmarks(repo).values():
35 for bm in repo._bookmarks.values():
36 36 blockers.append(repo[bm].rev())
37 37 blocked = cl.ancestors(blockers, inclusive=True)
38 38 return frozenset(r for r in hideable if r not in blocked)
@@ -8,7 +8,6 b''
8 8 import re
9 9 import parser, util, error, discovery, hbisect, phases
10 10 import node
11 import bookmarks as bookmarksmod
12 11 import match as matchmod
13 12 from i18n import _
14 13 import encoding
@@ -375,14 +374,14 b' def bookmark(repo, subset, x):'
375 374 _('the argument to bookmark must be a string'))
376 375 kind, pattern, matcher = _stringmatcher(bm)
377 376 if kind == 'literal':
378 bmrev = bookmarksmod.listbookmarks(repo).get(bm, None)
377 bmrev = repo._bookmarks.get(bm, None)
379 378 if not bmrev:
380 379 raise util.Abort(_("bookmark '%s' does not exist") % bm)
381 380 bmrev = repo[bmrev].rev()
382 381 return [r for r in subset if r == bmrev]
383 382 else:
384 383 matchrevs = set()
385 for name, bmrev in bookmarksmod.listbookmarks(repo).iteritems():
384 for name, bmrev in repo._bookmarks.iteritems():
386 385 if matcher(name):
387 386 matchrevs.add(bmrev)
388 387 if not matchrevs:
@@ -394,7 +393,7 b' def bookmark(repo, subset, x):'
394 393 return [r for r in subset if r in bmrevs]
395 394
396 395 bms = set([repo[r].rev()
397 for r in bookmarksmod.listbookmarks(repo).values()])
396 for r in repo._bookmarks.values()])
398 397 return [r for r in subset if r in bms]
399 398
400 399 def branch(repo, subset, x):
@@ -171,6 +171,18 b' divergent bookmarks'
171 171 Y 0:4e3505fd9583
172 172 Z 1:0d2164f0ce0d
173 173
174 revsets should not ignore divergent bookmarks
175
176 $ hg bookmark -fr 1 Z
177 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
178 0:4e3505fd9583 Y
179 1:9b140be10808 @ X Z foobar
180 2:0d2164f0ce0d @foo X@foo
181 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
182 2:0d2164f0ce0d @foo X@foo
183 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
184 2:0d2164f0ce0d @foo X@foo
185
174 186 update a remote bookmark from a non-head to a head
175 187
176 188 $ hg up -q Y
@@ -299,7 +311,7 b' hgweb'
299 311 @ 9b140be1080824d768c5a4691a564088eede71f9
300 312 X 9b140be1080824d768c5a4691a564088eede71f9
301 313 Y c922c0139ca03858f655e4a2af4dd02796a63969
302 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
314 Z 9b140be1080824d768c5a4691a564088eede71f9
303 315 foo 0000000000000000000000000000000000000000
304 316 foobar 9b140be1080824d768c5a4691a564088eede71f9
305 317 $ hg out -B http://localhost:$HGPORT/
@@ -1210,6 +1210,14 b' bookmarks prevent a changeset being hidd'
1210 1210 $ hg log --template '{rev}:{node}\n'
1211 1211 1:a765632148dc55d38c35c4f247c618701886cb2f
1212 1212 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1213 $ hg bookmark -d X
1214
1215 divergent bookmarks are not hidden
1216
1217 $ hg bookmark --hidden -r 1 X@foo
1218 $ hg log --template '{rev}:{node}\n'
1219 1:a765632148dc55d38c35c4f247c618701886cb2f
1220 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1213 1221
1214 1222 clear extensions configuration
1215 1223 $ echo '[extensions]' >> $HGRCPATH
General Comments 0
You need to be logged in to leave comments. Login now