how to obtain git's information when pulling in mercurial.
Manuel Jacob
me at manueljacob.de
Tue May 19 18:20:50 UTC 2020
On 2020-05-19 13:07, Uwe Brauer wrote:
> >> But even for pure mercurial repositories I have
> >> [hooks]
> >> changegroup.diffstat=hg diff --stat -r "p1($HG_NODE)" -r
> >> "max(descendants($HG_NODE))"
> >> outgoing=hg diff --stat -r "p1($HG_NODE)" -r
> >> "max(descendants($HG_NODE))"
> >> But still this seems not to provide the same amount of
> information,
> >> git
> >> provides.
> >> Any suggestions?
>
> > Apart from the missing hook, what information do you miss? For
>
> What hook is missing?
Sorry, my wording was imprecise. I meant "Apart from that the configured
hook was not executed, …".
> > questions like this, it’s unlikely that you get a helpful answer.
>
> Right, what I found helpful in the information git displayed are
> basically two things.
>
> 1. The renaming was clearly visible
> {Hoja 2 => hoja2}/mieuler.m |
> 0
> {Hoja 2 => hoja2}/mieulermej.m |
> 0
>
> 2. In Mercurial this looks like (a testing I did locally)
>
>
> pulling from /home/oub/HGTest/Clases/Server
> searching for changes
> Test.org | 6 ++++++
> test.org | 6 ------
> 2 files changed, 6 insertions(+), 6 deletions(-)
> adding changesets
> adding manifests
> adding file changes
> added 1 changesets with 1 changes to 1 files
> new changesets 5dade11f4e0f
> 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
> Test.org | 6 ++++++
> test.org | 6 ------
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> I guess it is a question of taste but I find the git representation a
> but more intuitive.
A diff or diffstat more similarly to Git can be enabled by either
1) setting
[diff]
git = True
or
2) passing "--git" to the "hg diff …" command.
When using hg-git, the similarity config (as described in the other
answer by Malcolm) must be enabled in addition. The reason is that Git
doesn’t store copy / rename information (it’s computed on the fly) while
Mercurial stores it explicitly (when the similarity config is set,
Mercurial infers and stores the copy / rename information when
converting from Git to Mercurial).
More information about the Mercurial
mailing list