Show More
@@ -861,12 +861,24 b' def annotate(web, req, tmpl):' | |||||
861 | f = fctx.path() |
|
861 | f = fctx.path() | |
862 | parity = paritygen(web.stripecount) |
|
862 | parity = paritygen(web.stripecount) | |
863 |
|
863 | |||
|
864 | # parents() is called once per line and several lines likely belong to | |||
|
865 | # same revision. So it is worth caching. | |||
|
866 | # TODO there are still redundant operations within basefilectx.parents() | |||
|
867 | # and from the fctx.annotate() call itself that could be cached. | |||
|
868 | parentscache = {} | |||
864 | def parents(f): |
|
869 | def parents(f): | |
|
870 | rev = f.rev() | |||
|
871 | if rev not in parentscache: | |||
|
872 | parentscache[rev] = [] | |||
865 | for p in f.parents(): |
|
873 | for p in f.parents(): | |
866 |
|
|
874 | entry = { | |
867 |
|
|
875 | 'node': p.hex(), | |
868 |
|
|
876 | 'rev': p.rev(), | |
869 | } |
|
877 | } | |
|
878 | parentscache[rev].append(entry) | |||
|
879 | ||||
|
880 | for p in parentscache[rev]: | |||
|
881 | yield p | |||
870 |
|
882 | |||
871 | def annotate(**map): |
|
883 | def annotate(**map): | |
872 | if util.binary(fctx.data()): |
|
884 | if util.binary(fctx.data()): |
General Comments 0
You need to be logged in to leave comments.
Login now