Reviewing Merges

0 views
Skip to first unread message

Johannes Stezenbach

unread,
Mar 8, 2009, 6:18:58 PM3/8/09
to mercuri...@selenic.com
Hi,

one of the linux/drivers/media/ developers using the Mercurial
repositories on linuxtv.org mentioned to me that it is too
difficult to review merges. I.e. after having reviewed
and tested the changes, the maintainer pulls and merges.
It should then be trivial for the developer to check that the
merge went well (or if the maintainer botched it).

Well, I thought that's easy, just use "hg view" (hgk) and
click on the merge changeset, it does the right thing.

But it turns out that:
a) hgk isn't installed by default
b) the merge review feature (i.e. suppression of uninteresting
changes in the merge changeset's diff) of hgk isn't documented
c) there appears to be no easy way to do the equivalent without hgk
(i.e. on the command line or using the web interface)

Or maybe I missed it, but I couldn't find anything with
a web search or in the Wiki.


As a simple example, look at
http://selenic.com/repo/index.cgi/hg/rev/edcb56991afe

What hgk does is:
- hg debug-merge-base to find 25fc4c620e54
- gather the list of files changed between the
merge base and both parents of edcb56991afe
- only show the diff for those files changed in both branches,
plus what the files the merge changeset itself changed

(or something like this, I didn't have the patience to
read through the hgk Tcl/Tk code in detail)

Which is much easier to digest, and if the merge
was trivial this hgk diff is empty, which is the desired
proof that the merge is OK (e.g. for b136c6c5c1c7
or 896eaa1337bf).


I'm currently not able to pursue this issue myself, it would
be cool if someone could look into this. Or give me some
pointers in case I missed something obvious.


Thanks,
Johannes
_______________________________________________
Mercurial-devel mailing list
Mercuri...@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel

Giorgos Keramidas

unread,
Mar 8, 2009, 10:06:01 PM3/8/09
to Johannes Stezenbach, mercuri...@selenic.com
On Sun, 8 Mar 2009 23:18:58 +0100, Johannes Stezenbach <j...@sig21.net> wrote:
> Hi,
>
> one of the linux/drivers/media/ developers using the Mercurial
> repositories on linuxtv.org mentioned to me that it is too
> difficult to review merges. I.e. after having reviewed
> and tested the changes, the maintainer pulls and merges.
> It should then be trivial for the developer to check that the
> merge went well (or if the maintainer botched it).
>
> Well, I thought that's easy, just use "hg view" (hgk) and
> click on the merge changeset, it does the right thing.
>
> But it turns out that:
> a) hgk isn't installed by default
> b) the merge review feature (i.e. suppression of uninteresting
> changes in the merge changeset's diff) of hgk isn't documented
> c) there appears to be no easy way to do the equivalent without hgk
> (i.e. on the command line or using the web interface)
>
> Or maybe I missed it, but I couldn't find anything with
> a web search or in the Wiki.

There's always the option of doing:

hg diff -c REV | less

I very rarely use hgk these days, but I often use graphlog and the -c
option of diff :)

Steve Borho

unread,
Mar 8, 2009, 11:56:02 PM3/8/09
to Johannes Stezenbach, mercuri...@selenic.com
On Sun, Mar 8, 2009 at 5:18 PM, Johannes Stezenbach <j...@sig21.net> wrote:
> Hi,
>
> one of the linux/drivers/media/ developers using the Mercurial
> repositories on linuxtv.org mentioned to me that it is too
> difficult to review merges.  I.e. after having reviewed
> and tested the changes, the maintainer pulls and merges.
> It should then be trivial for the developer to check that the
> merge went well (or if the maintainer botched it).
>
> Well, I thought that's easy, just use "hg view" (hgk) and
> click on the merge changeset, it does the right thing.

There is also:
http://bitbucket.org/tortoisehg/stable/wiki/hgtk

I think hgtk log does a better job than hgk with merge
changesets. It allows you to toggle between the diffs to
both parents.

--
Steve Borho

0000 vk

unread,
Mar 9, 2009, 12:00:40 PM3/9/09
to Giorgos Keramidas, mercuri...@selenic.com
On Sun, Mar 8, 2009 at 10:06 PM, Giorgos Keramidas <kera...@ceid.upatras.gr> wrote:
On Sun, 8 Mar 2009 23:18:58 +0100, Johannes Stezenbach <j...@sig21.net> wrote:
> Hi,
>
> one of the linux/drivers/media/ developers using the Mercurial
> repositories on linuxtv.org mentioned to me that it is too
> difficult to review merges.  I.e. after having reviewed
> and tested the changes, the maintainer pulls and merges.
> It should then be trivial for the developer to check that the
> merge went well (or if the maintainer botched it).
>
> Well, I thought that's easy, just use "hg view" (hgk) and
> click on the merge changeset, it does the right thing.
>
> But it turns out that:
> a) hgk isn't installed by default
> b) the merge review feature (i.e. suppression of uninteresting
>    changes in the merge changeset's diff) of hgk isn't documented
> c) there appears to be no easy way to do the equivalent without hgk
>    (i.e. on the command line or using the web interface)
>
> Or maybe I missed it, but I couldn't find anything with
> a web search or in the Wiki.

There's always the option of doing:

   hg diff -c REV | less

I very rarely use hgk these days, but I often use graphlog and the -c
option of diff :)

-c option is only available as of 1.2

vk


 

Johannes Stezenbach

unread,
Mar 9, 2009, 12:52:09 PM3/9/09
to mercuri...@selenic.com
Hi,

On Sun, Mar 08, 2009 at 10:56:02PM -0500, Steve Borho wrote:
> On Sun, Mar 8, 2009 at 5:18 PM, Johannes Stezenbach <j...@sig21.net> wrote:
> >
> > one of the linux/drivers/media/ developers using the Mercurial
> > repositories on linuxtv.org mentioned to me that it is too
> > difficult to review merges.  I.e. after having reviewed
> > and tested the changes, the maintainer pulls and merges.
> > It should then be trivial for the developer to check that the
> > merge went well (or if the maintainer botched it).
> >
> > Well, I thought that's easy, just use "hg view" (hgk) and
> > click on the merge changeset, it does the right thing.
>
> There is also:
> http://bitbucket.org/tortoisehg/stable/wiki/hgtk
>
> I think hgtk log does a better job than hgk with merge
> changesets. It allows you to toggle between the diffs to
> both parents.

Thanks for the pointer, but I did not ask for another
GUI, I'm happy with hgk.

"hg diff -c" is also not what I asked for. What I had
in mind is "hg diff --merge"...

("hg export --switch-parent" is also not what I want,
although it helps it's just not the same as the hgk diff)


One would think a VCS which makes frequent merges easy
would also give the user the tools to _easily_ verify that
the merge did not introduce any errors?


Thanks,
Johannes

Giorgos Keramidas

unread,
Mar 10, 2009, 3:47:28 AM3/10/09
to 0000 vk, mercuri...@selenic.com

Yes, of course. I keep forgetting that running both the latest main/
branch and the latest crew/ branch is not what everyone does. Thanks
for the kind reminder :-)

Reply all
Reply to author
Forward
0 new messages