Show More
@@ -1246,12 +1246,21 b' def diff(repo, node1=None, node2=None, m' | |||||
1246 | if not node1: |
|
1246 | if not node1: | |
1247 | node1 = repo.dirstate.parents()[0] |
|
1247 | node1 = repo.dirstate.parents()[0] | |
1248 |
|
1248 | |||
1249 | flcache = {} |
|
1249 | def lrugetfilectx(): | |
1250 | def getfilectx(f, ctx): |
|
1250 | cache = {} | |
1251 | flctx = ctx.filectx(f, filelog=flcache.get(f)) |
|
1251 | order = [] | |
1252 | if f not in flcache: |
|
1252 | def getfilectx(f, ctx): | |
1253 | flcache[f] = flctx._filelog |
|
1253 | fctx = ctx.filectx(f, filelog=cache.get(f)) | |
1254 | return flctx |
|
1254 | if f not in cache: | |
|
1255 | if len(cache) > 20: | |||
|
1256 | del cache[order.pop(0)] | |||
|
1257 | cache[f] = fctx._filelog | |||
|
1258 | else: | |||
|
1259 | order.remove(f) | |||
|
1260 | order.append(f) | |||
|
1261 | return fctx | |||
|
1262 | return getfilectx | |||
|
1263 | getfilectx = lrugetfilectx() | |||
1255 |
|
1264 | |||
1256 | ctx1 = repo[node1] |
|
1265 | ctx1 = repo[node1] | |
1257 | ctx2 = repo[node2] |
|
1266 | ctx2 = repo[node2] |
General Comments 0
You need to be logged in to leave comments.
Login now