Patchwork [4,of,9] debugrevlog: format columns (more) nicely when dumping index data

login
register
mail settings
Submitter Mads Kiilerich
Date March 18, 2014, 11:33 p.m.
Message ID <707d9e8921215ad47b5b.1395185632@localhost.localdomain>
Download mbox | patch
Permalink /patch/3975/
State Accepted
Headers show

Comments

Mads Kiilerich - March 18, 2014, 11:33 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1395184418 -3600
#      Wed Mar 19 00:13:38 2014 +0100
# Node ID 707d9e8921215ad47b5b1712f6c06b0d345c6296
# Parent  73968b322f241048e1e5fc2de8ba6dcd9f31809a
debugrevlog: format columns (more) nicely when dumping index data
Matt Mackall - April 14, 2014, 7:52 p.m.
On Wed, 2014-03-19 at 00:33 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1395184418 -3600
> #      Wed Mar 19 00:13:38 2014 +0100
> # Node ID 707d9e8921215ad47b5b1712f6c06b0d345c6296
> # Parent  73968b322f241048e1e5fc2de8ba6dcd9f31809a
> debugrevlog: format columns (more) nicely when dumping index data

Seems to not break gnuplot, so probably fine. Queued for default,
thanks.
Augie Fackler - April 15, 2014, 1:27 a.m.
On Apr 14, 2014, at 3:52 PM, Matt Mackall <mpm@selenic.com> wrote:

>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1395184418 -3600
>> #      Wed Mar 19 00:13:38 2014 +0100
>> # Node ID 707d9e8921215ad47b5b1712f6c06b0d345c6296
>> # Parent  73968b322f241048e1e5fc2de8ba6dcd9f31809a
>> debugrevlog: format columns (more) nicely when dumping index data
> 
> Seems to not break gnuplot, so probably fine. Queued for default,
> thanks.

What gnuplot spell is this? It'd be nice to have it mentioned here so I can search for it somehow...
Matt Mackall - April 15, 2014, 3:36 a.m.
On Mon, 2014-04-14 at 21:27 -0400, Augie Fackler wrote:
> On Apr 14, 2014, at 3:52 PM, Matt Mackall <mpm@selenic.com> wrote:
> 
> >> # HG changeset patch
> >> # User Mads Kiilerich <madski@unity3d.com>
> >> # Date 1395184418 -3600
> >> #      Wed Mar 19 00:13:38 2014 +0100
> >> # Node ID 707d9e8921215ad47b5b1712f6c06b0d345c6296
> >> # Parent  73968b322f241048e1e5fc2de8ba6dcd9f31809a
> >> debugrevlog: format columns (more) nicely when dumping index data
> > 
> > Seems to not break gnuplot, so probably fine. Queued for default,
> > thanks.
> 
> What gnuplot spell is this? It'd be nice to have it mentioned here so I can search for it somehow...

hg debugrevlog -cd > foo.dat
gnuplot -e 'set terminal dumb; plot "foo.dat" using 2:4'

That's like the worst plot you can get, but it should get you started.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2465,7 +2465,7 @@  def debugrevlog(ui, repo, file_=None, **
 
     if opts.get("dump"):
         numrevs = len(r)
-        ui.write("# rev p1rev p2rev start end deltastart base p1 p2"
+        ui.write("# rev p1rev p2rev start   end deltastart base   p1   p2"
                  " rawsize totalsize compression heads\n")
         ts = 0
         heads = set()
@@ -2479,7 +2479,7 @@  def debugrevlog(ui, repo, file_=None, **
             ts = ts + rs
             heads -= set(r.parentrevs(rev))
             heads.add(rev)
-            ui.write("%d %d %d %d %d %d %d %d %d %d %d %d %d\n" %
+            ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d %11d %5d\n" %
                      (rev, p1, p2, r.start(rev), r.end(rev),
                       r.start(dbase), r.start(cbase),
                       r.start(p1), r.start(p2),