hg log -G for bookmarks
Simon King
simon at simonking.org.uk
Fri Feb 5 15:33:13 UTC 2016
On Fri, Feb 5, 2016 at 10:59 AM, Uwe Brauer <oub at mat.ucm.es> wrote:
> >>> "Matt" == Matt Mackall <mpm at selenic.com> writes:
>
> > On Thu, 2016-02-04 at 15:13 +0000, Uwe Brauer wrote:
> >> Branches: I did
>
> > I'm going to draw a graph of your repo at each step, sideways, time
> left to
> > right.
>
> thanks
>
> >> hg log -Gr '::bookmark()'
>
> > The -r '::bookmark()' is unnecessary.
>
> Most likely I misunderstood Simon.
>
> > This output is fully correct. To get a graph analogous to your first
> one, do:
>
> Thanks very much. That was *extremely* helpful, because
>
> - I understood now, that there is a difference between:
>
> hg branch master
> hg commit -m "3"
>
> And
>
> hg bookmark master
> hg commit -m "3"
>
> That was not clear to me before.
>
> - I am now more convinced than ever that I prefer named branches
> over bookmarks.
>
>
> But there is a small side effect of this, which concerns the git-hg
> plugin.
>
> Recently there was a discussing on the matlab-emacs list to switch from
> CVS to a more modern system, unfortunately git won over hg (I was the
> only one who voted for hg).
>
> So I would like to use the hg-git plugin and, then of course I cannot
> use named named branches, because the hg-git plugin does not translate
> them well, I should use bookmarks then.
>
> What puzzled me was the following: modifying your approach (replaching @
> by master because git needs it) I did
>
>
> hg init
> hg bookmark master
> echo one > test.txt
> hg add test.txt
> hg commit -m "0"
> hg bookmark book1
> echo two >> test.txt
> hg commit -m "1"
> echo three >> test.txt
> hg commit -m "2"
> hg update master
> echo four >> test.txt
> hg commit -m "3"
> hg log -G
>
> Which gives the graph we discussed.
>
> I pushed that to an empty git repo
> but then
> git log --graph --all --decorate
> gave
> * commit ddda480004d1baf240d6e65232d59216141da16c (book1)
> | Author: Uwe Brauer <oub at mat.ucm.es>
> | Date: Fri Feb 5 10:42:58 2016 +0000
> |
> | 2
> |
> * commit 69dd9be92747de9b8e3dc49563ae41807e58a8bb
> | Author: Uwe Brauer <oub at mat.ucm.es>
> | Date: Fri Feb 5 10:42:57 2016 +0000
> |
> | 1
> |
> | * commit d79d64d89c863d702a5c1dee4532c3372d5b55cc (HEAD, master)
> |/ Author: Uwe Brauer <oub at mat.ucm.es>
> | Date: Fri Feb 5 10:42:58 2016 +0000
> |
> | 3
> |
> * commit f3b0ceb79f80c096e37db006a1eff51e9a69ca46
> Author: Uwe Brauer <oub at mat.ucm.es>
> Date: Fri Feb 5 10:42:56 2016 +0000
>
> 0
>
> Which is not exactly the same, as the result of
>
> hg log -G
>
> Regards
>
> Uwe Brauer
>
>
This is what I see in the mercurial version:
@ 3 3 (81 seconds ago by Simon King) [master] tip
|
| o 2 2 (82 seconds ago by Simon King) [book1]
| |
| o 1 1 (83 seconds ago by Simon King)
|/
o 0 0 (84 seconds ago by Simon King)
Which as far as I can tell is equivalent to the git version. There are 2
branches from a common ancestor. The "master" branch has a single commit
with description "3", and the "book1" branch contains 2 commits with
descriptions "1" and "2".
Note that there are many ways to lay out the same graph, so the display
isn't necessarily going to be identical, but the relationships between the
nodes should always be the same.
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20160205/bb588145/attachment-0002.html>
More information about the Mercurial
mailing list