hg log -G for bookmarks

John W jwdevel at gmail.com
Thu Feb 4 17:33:55 UTC 2016


On 2/4/16, Uwe Brauer <oub at mat.ucm.es> wrote:
>
> So the question is how do I get a graph, with a tree, with trunk and
> branches as in the first case.
>

I think I understand what you're asking - you want
__every_single_change__ along a given line of development to have the
same "bookmark: xyz" line displayed in the graph.
Bookmarks, by default, only mark a single change, and currently you
would have to analyze the graph in order to know which other revisions
are in the same lineage. You want Mercurial to do this analysis for
you.

Assuming I got that right, I guess I'd say (1) this may still be
somewhat possible, but (2) there may be other issues you don't like
with this approach.

Let's suppose that we could solve (1) and get the graph output the way you like.
Even so, a bookmark can be pointed to another revision arbitrarily.
So by running "hg bookmark -f --rev xyz mybranch" you will change
where "mybranch" points. This could completely change the output,
making it look like some different line of development is now called
"mybranch" where it wasn't a moment ago.
With named branches, you can't do this. The name of the branch is
"baked in" to every change. I suspect you probably prefer the latter,
so even if we solve (1) you may not like it...

Another issue: Let's suppose we have a graph that is forked.

         ---- branch A
        /
---X--------- branch B
        \
         ---- branch C

In our "hg log -G" output, what branch should X belong to?
With named branches, we already know, because that information was
recorded at the point in time that X was committed.
But with bookmarks, all we have are pointers to the tips A, B, and C.
We would have to use some heuristics to guess what X should belong to,
and we could guess wrong. There really is no way to know for sure,
that I can think of.

So, I imagine that even if we got the output the way you like, the
above issues might still be problems for you with the bookmarks
approach.

But if not, then we can still discuss how best to achieve (1) (:

-John



More information about the Mercurial mailing list