graphlog: use built-in log output buffering
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Fri, 14 Nov 2008 13:48:23 +0100
changeset 7371 6ad2b914acbd
parent 7370 7bc62ebe7693
child 7372 e17dbf140035
graphlog: use built-in log output buffering
hgext/graphlog.py
--- a/hgext/graphlog.py	Fri Nov 14 13:44:10 2008 +0100
+++ b/hgext/graphlog.py	Fri Nov 14 13:48:23 2008 +0100
@@ -281,16 +281,15 @@
         revdag = revisions(repo, start, stop)
 
     repo_parents = repo.dirstate.parents()
-    displayer = show_changeset(ui, repo, opts)
+    displayer = show_changeset(ui, repo, opts, buffered=True)
     def graphabledag():
         for (ctx, parents) in revdag:
             # log_strings is the list of all log strings to draw alongside
             # the graph.
-            ui.pushbuffer()
             displayer.show(ctx)
-            log_strings = ui.popbuffer().split("\n")[:-1]
+            lines = displayer.hunk.pop(ctx.rev()).split("\n")[:-1]
             char = ctx.node() in repo_parents and '@' or 'o'
-            yield (ctx.rev(), parents, char, log_strings)
+            yield (ctx.rev(), parents, char, lines)
 
     ascii(ui, grapher(graphabledag()))