tools and contributions

Issue 160: monotone-viz doesn't handle 'suspend'

Reported by Richard Levitte, Apr 6, 2011

Since monotone-viz was last hacked at, monotone got the 'suspend' 
feature.
Unfortunately, monotone-viz doesn't handle it at all, as far as I 
can see, and will happily show branches where the head revision is 
suspended.  I'd very much like to see a change where lines of 
development with head being suspended aren't shown.
The selection dialog could have a checkbox where one could choose if 
one would like to see the suspended lines of development or not...

Comment 1 by Richard Levitte, Apr 7, 2011

*bump (for email)*

Comment 2 by Francis Russell, Apr 7, 2011

Are you sure you've got that the right way round? Running 
monotone-viz, I can't enable viewing of any suspended branches since 
they don't appear. This is far more annoying since after I've merged 
and suspended a branch, I can't view its history in monotone-viz.

Comment 3 by Richard Levitte, Apr 7, 2011

Ah-hah!  You're quite right, in the most normal case...  I guess 
I've stumbled on a special case, which can be reproduced like this:

cd /tmp
mtn -d foo.mtn db init
mtn -d foo.mtn setup foo -b foo
cd foo
echo a > a; mtn add a; mtn ci -m a a
echo b >> a; mtn ci -m a a
mtn suspend w:
cd ..
mtn -d foo.mtn setup foo2 -b foo
cd foo2
echo c > c; mtn add c; mtn ci -m c c
echo d >> c; mtn ci -m c c
mtn-viz

Presto, you get to see both lines of development (both in branch 
foo), even though one of them is suspended.

My personal setup is that I basically had to redo a series of 
commits as a branch of another project instead of a standalone 
branch, then suspended the standalone branch...  needless to say, 
it's a little irritating to still see it in mtn-viz

Comment 4 by Richard Levitte, Apr 18, 2011

The fault is really in how it's called...  I've had a look at what 
mtn-viz does when it tries to figure things out.  It seems that it 
selects revisions like this:

l6:selectN:b:BRANCH/l:DATE/e:DATE

That one will return anything that is in said branch within those 
dates, and doesn't care about the suspend cert (it wouldn't matter 
much, if it did, we would simply not see the suspended revisions, 
but would still see the revisions in that same branch that aren't 
suspended).

It's quite possible that monotone-viz should do it a bit more work, 
I'm imagining something corresponding to the following:

for b in `mtn automate branches`; do
    for r in `mtn automate heads $b; do
        mtn select "ancestors($r)/l:DATE/e:DATE"
    done
done

... except it seems that composite selectors don't quite work that 
way for now (perhaps it's a bug in monotone?).

Comment 5 by Thomas Moschny, Apr 18, 2011

Shouldn't something like this work:

mtn au select 'l:DATE/e:DATE/(ancestors(h:*)|h:*)'

- it does for the little test case.

(Interestingly, if one commutes the expression like this:

mtn au select '(ancestors(h:*)|h:*)/l:DATE/e:DATE'

mtn complains about an unmatched paren, and that seems like a bug in 
monotone.)

Comment 6 by Tony Cooper, Apr 20, 2011

Because the stdio version of monotone-viz was far too slow for our 
work db (older direct access one would take say 10 seconds for a 
given query, new stdio one would take 2-3 minutes). I am currently 
working on a similar facility in mtn-browse. The critical thing 
being that if I couldn't match the performance of the old version 
then there's no point. Anyway I managed it.

Also trying to get a list of unsuspended branches can be very slow 
(when there are a large number say ~1500) and one usually ends up 
using the --ignore-suspended switch. mtn-browse had to offer this 
feature for performance reasons (50 seconds vs 1).

The key point is to keep the stdio stuff to a minimum couple of 
selects along the lines of l6:selectN:b:BRANCH/l:DATE/e:DATE and 
then do as much work as possible in the app at the expense of memory 
as stdio is the bottleneck.

Also when should a suspended branch be shown? Never not even if it 
at some point was merged into another unsuspended branch? What about 
date ranges cropping the suspended head revisions?

All adds to complexity and performance overhead.

What is unavoidable is at some point you have to get the certs for 
those revisions you display (e.g. what about branch/author 
colouring?). At that point you could determine what selected 
branches have a suspend cert on any of their revisions being graphed 
and then act accordingly (i.e. highlight in some way or exclude). 
This is by no means ideal but does have explainable logic behind it. 
I.e. suspended revisions are displayed if at that point in the graph 
they weren't suspended...?

Created: 13 years 1 month ago by Richard Levitte

Updated: 13 years 17 days ago

Status: New

Followed by: 3 persons

Labels:
Type:Enhancement
Priority:High
OpSys:All
Component:Logic
Component:UI
Other:Usability

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status