hg-git: indirect cloning screws up the graph?

Sietse Brouwer sbbrouwer at gmail.com
Sun Oct 9 11:38:40 UTC 2016


Hi Uwe,

Both your clones know the same history, and are functionally
identical. The history is just displayed differently.

The order in which `hg log` displays commits is determined by the
local rev number: that incrementing number. If you have a bunch of
commits 0...N, and you pull in a new buch,  that new bunch will get
numbers N+1..., and will be displayed topmost in your `hg log` graph.

auctex-hg-direct pulled directly from Savannah, so it got all commits
in the order git presented them, and the `master` commit ended up
tipmost.

Local git clones default to only promoting master to local branch. So,
if one makes a local git clone, makes an hg-indirect clone of that,
and then pulls from Savannah, all commits that aren't ancestors of
master will displayed higher up the log.

That glut of merge commits is already present in the git history,
you'll hit if if you run

    git log --graph --all --oneline --decorate

and keep scrolling down. It's not in the ancestry of master, but it is
in the ancestry of branch simplify-TeX-parse-error. So, your indirect
clone got that glut of merge commits at a later stage, gave them
higher numbers, and displayed them higher up in the graphical log. The
topology is still the same.

As for your other remark:

> hg heads | grep changeset | wc -l
> reveals 48 (!) Heads.

Nearly all those heads are tags, you can see that like so:  hg log
--rev 'head()' --template '{gitnode|short} -- {bookmarks} -- {tags}\n'

Hope this helps!

Cheers,

Sietse
Sietse Brouwer

--
Sietse Brouwer -- sbbrouwer at gmail.com -- +31 6 13.456.848
Korte Langestraat 2 -- 2312 SK Leiden -- the Netherlands


On 2 October 2016 at 18:12, Uwe Brauer <oub at mat.ucm.es> wrote:
> Hi
>
> That is sort of absurd.
>
> I do the following.
>
>     -  hg clone git://git.savannah.gnu.org/auctex.git auctex-hg-direct
>
>  cd auctex-hg-direct
>  hg log -G
> @  changeset:   6854:a9996373b4cb
> |  bookmark:    master
> |  tag:         default/master
> |  tag:         tip
> |  user:        Mosè Giordano <mose at gnu.org>
> |  date:        Tue Sep 27 12:30:37 2016 +0200
> |  summary:     Fix to my previous commit
> |
> o  changeset:   6853:948be918f3e7
> |  user:        Tassilo Horn <tsdh at gnu.org>
> |  date:        Mon Sep 19 18:11:52 2016 +0200
> |  summary:     Improve docs added/changed in last commit
>
>
>  looks ok, but
>  hg heads | grep changeset | wc -l
>  reveals 48 (!) Heads.
>
> Now to method 2
>     -  git clone git://git.savannah.gnu.org/auctex.git auctex-git
>     -  hg clone auctex-git auctex-hg-indirect
>
> (Not all bookmarks have been pulled), so I edit .hg/hgrc in
> auctex-hg-indirect
> from
> [paths]
> default = /home/oub/ALLES/emacs/site-lisp/packages/src/Git/auctex-git
>
>
> To
> path
> default = git://git.savannah.gnu.org/auctex.git
>
> And I run
>
> Hg pull
>
>
> Then the graph looks like
>
> o    changeset:   6854:1ea19cbde4cc
> |\   bookmark:    simplify-TeX-parse-error
> | |  tag:         default/simplify-TeX-parse-error
> | |  tag:         tip
> | |  parent:      6853:d7b23896a7d5
> | |  parent:      6528:80948ef561c8
> | |  user:        Tassilo Horn <tsdh at gnu.org>
> | |  date:        Sun Jan 31 08:17:25 2016 +0100
> | |  summary:     Merge branch 'master' into simplify-TeX-parse-error
> | |
> | o    changeset:   6853:d7b23896a7d5
> | |\   parent:      6852:12c6282c9bb7
> | | |  parent:      6519:b78b35b2dfc9
> | | |  user:        Tassilo Horn <tsdh at gnu.org>
> | | |  date:        Sun Jan 24 06:32:22 2016 +0100
> | | |  summary:     Merge branch 'master' into simplify-TeX-parse-error
>
> and more and more merges lines appear till the graph is unreadable.
>
> What is the reason for this strange behavior?
>
> Uwe Brauer
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial



More information about the Mercurial mailing list