##// END OF EJS Templates
bookmarks: cache reverse mapping (issue5868)...
bookmarks: cache reverse mapping (issue5868) I chose a simpler implementation. If the initial cost of building reverse mapping is significant, we'll have to move it under @propertycache. The nodemap could be a dict of sets, but I think keeping a sorted list is better since each node is likely to have zero/one bookmark. Micro-benchmark with 1001 bookmarks and 1001 revisions: $ for n in `seq 0 1000`; do touch $n; hg book book$n; hg ci -qAm$n; done $ hg bookmarks --time > /dev/null (orig) time: real 0.040 secs (user 0.050+0.000 sys 0.000+0.000) (new) time: real 0.040 secs (user 0.040+0.000 sys 0.010+0.000) $ hg log -T '{bookmarks}\n' --time > /dev/null (orig) time: real 0.160 secs (user 0.160+0.000 sys 0.000+0.000) (new) time: real 0.090 secs (user 0.100+0.000 sys 0.000+0.000)

File last commit:

r36498:4dc6f090 default
r37869:04ceb267 @26 default
Show More
fakemergerecord.py
26 lines | 752 B | text/x-python | PythonLexer
/ tests / fakemergerecord.py
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 # Extension to write out fake unsupported records into the merge state
#
#
from __future__ import absolute_import
from mercurial import (
merge,
Yuya Nishihara
registrar: move cmdutil.command to registrar module (API)...
r32337 registrar,
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 )
cmdtable = {}
Yuya Nishihara
registrar: move cmdutil.command to registrar module (API)...
r32337 command = registrar.command(cmdtable)
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027
Augie Fackler
tests: port fakemergerecord to python3...
r36191 @command(b'fakemergerecord',
[(b'X', b'mandatory', None, b'add a fake mandatory record'),
(b'x', b'advisory', None, b'add a fake advisory record')], '')
Siddharth Agarwal
mergestate: handle additional record types specially...
r27027 def fakemergerecord(ui, repo, *pats, **opts):
Pierre-Yves David
fakemergerecord: take wlock to write the merge state...
r29754 with repo.wlock():
ms = merge.mergestate.read(repo)
records = ms._makerecords()
Pulkit Goyal
py3: backout changeset 56635c506608 which wrongly added couple of b''...
r36498 if opts.get('mandatory'):
Augie Fackler
tests: port fakemergerecord to python3...
r36191 records.append((b'X', b'mandatory record'))
Pulkit Goyal
py3: backout changeset 56635c506608 which wrongly added couple of b''...
r36498 if opts.get('advisory'):
Augie Fackler
tests: port fakemergerecord to python3...
r36191 records.append((b'x', b'advisory record'))
Pierre-Yves David
fakemergerecord: take wlock to write the merge state...
r29754 ms._writerecords(records)