Merging with descendants
Stephen Lee
sphen.lee at gmail.com
Tue Jul 23 00:42:08 UTC 2013
On Mon, Jul 22, 2013 at 6:22 PM, Kastner Masilko, Friedrich
<kastner-masilko at at.festo.com> wrote:
>> From: mercurial-bounces at selenic.com [mailto:mercurial-bounces at selenic.com] On Behalf Of Stephen Lee
>>
>> A problem that keeps arising is a developer cloning and creating a
>> bookmark to start working on a bug. Before committing anything they get
>> distracted by another bug, and after some time return to the original
>> bug. Since the clone is now out-of-date they run pull and merge -
>> adding a totally useless and confusing Oedipus merge to the history.
>> They should have run update instead.
>
> Why exactly was it a problem? Besides DAG aesthetics, I mean.
Aesthetics was mostly the issue - the resulting graph and diffs
confuse the developers. This should fade over time, but since we have
only recently adopted Mercurial it has been a problem.
The other problem is that instead of Mercurial aborting and suggesting
update instead, which encourages people to learn the difference
between update and merge, developers just kept doing it without
realising.
This goes back to the question of "how can hg merge <rev>" be
accidental? Answer: when all heads are bookmarked and developers get
into the habit of typing "hg merge @"
>
>> So agreeing with Matt here - Oedipus merges should not be in core.
>
> Technically, they are already in. If you merge named branches, you can create Oedipus merges. While they might not seem like so (because at least the named branch meta-data has changed), the underlying effects for later merges will be the same. The only reason why they are not possible today with anonymous branches (and in direct consequence for bookmarks as well), is an artificial block in the commit code. But we already talked about that.
>
Technically yes - merging between named branches allows an Oedipus
merge. What I meant was: status quo is now my preference.
The named branch exception allows us to implement our branch auditing
requirement.
> IIRC, we talked also about only allowing Oedipus merges with a specified revision ("hg merge --rev REV"), and then also warn if an Oedipus merge happened. Did you implement this? I'm asking because I would understand your problem better if only the block was removed unconditionally, so that a simple "hg merge" would do Oedipus merges, too.
What I implemented was: if both parents of the merge were bookmarked,
allow a merge with ancestor.
"hg merge" with no rev specified always gives the "all heads are
bookmarked" error in our repo so developers must always specify a rev
to merge with.
I didn't add a warning either since in my experience no-one ever reads
command output until they notice something wrong - and in this case I
doubt anyone would. Incedentally this is one the things I love about
Mercurial: when hg prints something, it's actually important to read.
Unlike git that dumps pages of irrelevant diffstats, branch ref SHA
values etc...
Steve
More information about the Mercurial
mailing list