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