comparison mercurial/commands.py @ 9222:50cf61eb33e0

merge with stable
author Martin Geisler <mg@lazybytes.net>
date Thu, 16 Jul 2009 16:55:17 +0200
parents 431462bd8478
children bbc78cb1bf15 98d90ad54749
comparison
equal deleted inserted replaced
9221:7469a87dfbbf 9222:50cf61eb33e0
1204 return None 1204 return None
1205 sep, eol = ':', '\n' 1205 sep, eol = ':', '\n'
1206 if opts.get('print0'): 1206 if opts.get('print0'):
1207 sep = eol = '\0' 1207 sep = eol = '\0'
1208 1208
1209 fcache = {} 1209 getfile = util.lrucachefunc(repo.file)
1210 forder = []
1211 def getfile(fn):
1212 if fn not in fcache:
1213 if len(fcache) > 20:
1214 del fcache[forder.pop(0)]
1215 fcache[fn] = repo.file(fn)
1216 else:
1217 forder.remove(fn)
1218
1219 forder.append(fn)
1220 return fcache[fn]
1221 1210
1222 def matchlines(body): 1211 def matchlines(body):
1223 begin = 0 1212 begin = 0
1224 linenum = 0 1213 linenum = 0
1225 while True: 1214 while True: