Mercurial > hg-stable
changeset 25763:60c791592aa7
changeset_printer: change flush() to accept ctx instead of rev
Because flush() is the function to write data buffered by show(ctx),
flush(ctx) is more consistent than flush(rev). This makes sure that
buffered header and hunk are always keyed by ctx.rev().
This patch will allow us to give an integer to the wdir while keeping
wctx.rev() -> None.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 12 Apr 2015 21:52:02 +0900 |
parents | f4412380d357 |
children | 22049b565d57 |
files | mercurial/cmdutil.py mercurial/commands.py |
diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Jul 04 17:19:49 2015 +0900 +++ b/mercurial/cmdutil.py Sun Apr 12 21:52:02 2015 +0900 @@ -1119,7 +1119,8 @@ self.lastheader = None self.footer = None - def flush(self, rev): + def flush(self, ctx): + rev = ctx.rev() if rev in self.header: h = self.header[rev] if h != self.lastheader: @@ -2156,7 +2157,7 @@ lines = displayer.hunk.pop(rev).split('\n') if not lines[-1]: del lines[-1] - displayer.flush(rev) + displayer.flush(ctx) edges = edgefn(type, char, lines, seen, rev, parents) for type, char, lines, coldata in edges: graphmod.ascii(ui, state, type, char, lines, coldata)
--- a/mercurial/commands.py Sat Jul 04 17:19:49 2015 +0900 +++ b/mercurial/commands.py Sun Apr 12 21:52:02 2015 +0900 @@ -4627,7 +4627,7 @@ else: revmatchfn = None displayer.show(ctx, copies=copies, matchfn=revmatchfn) - if displayer.flush(rev): + if displayer.flush(ctx): count += 1 displayer.close()