##// END OF EJS Templates
files: speed up `hg files` when no flags change display...
Valentin Gatien-Baron -
r45388:065421e1 default
parent child Browse files
Show More
@@ -2752,6 +2752,19 def files(ui, ctx, m, uipathfn, fm, fmt,
2752 ret = 1
2752 ret = 1
2753
2753
2754 needsfctx = ui.verbose or {b'size', b'flags'} & fm.datahint()
2754 needsfctx = ui.verbose or {b'size', b'flags'} & fm.datahint()
2755 if fm.isplain() and not needsfctx:
2756 # Fast path. The speed-up comes from skipping the formatter, and batching
2757 # calls to ui.write.
2758 buf = []
2759 for f in ctx.matches(m):
2760 buf.append(fmt % uipathfn(f))
2761 if len(buf) > 100:
2762 ui.write(b''.join(buf))
2763 del buf[:]
2764 ret = 0
2765 if buf:
2766 ui.write(b''.join(buf))
2767 else:
2755 for f in ctx.matches(m):
2768 for f in ctx.matches(m):
2756 fm.startitem()
2769 fm.startitem()
2757 fm.context(ctx=ctx)
2770 fm.context(ctx=ctx)
General Comments 0
You need to be logged in to leave comments. Login now