[MERGE] Fix bug #235407, when the same revision is merged twice

Robert Collins robertc at robertcollins.net
Mon Jun 2 06:25:03 BST 2008


On Mon, 2008-06-02 at 00:05 -0500, John Arbash Meinel wrote:
> 
> I still disagree that we should allow status to fail under these
> conditions.
> Whether the actual test will be valid.
>
> As for add_parent_id, what about set_parent_trees, etc. Are you sure
> that they
> should all be doing a heads() call? It seems like we could have the
> caller be
> responsible.

There is a tension there - yes, but it seems safer to have one choke
point rather than hoping all callers do the right thing.

> As for --force/--no-force. You can't *do* another merge without
> --force. So
> there is no way to cause that effect from the command line.

Right, but --force doesn't alter the merge, it just alters whether a
merge is permitted.

> I personally feel like the check should be happening much earlier in
> 'merge'
> when it is looking for the common ancestor, so that it can give you
> 'Nothing to
> do'. Not to mention give you a better merge base regardless.

Agreed. But that is a deeper change.

> My quick probe into it makes it somewhat non-trivial. The problem is
> that a lot
> of the merge code is written in terms of branches, rather than in
> terms of
> trees. In other places we have faked a Graph with a parent provider
> that gives
> 'CURRENT => (merge-parents)' which works well for finding the LCA with
> multiple
> merge parents. But at the time 'find_lca' is being called, we only
> have branches.
> 
> So... I'll see if I can get merge fixed still, but I still feel this
> is a
> reasonable fix.

concretely, if you look at 'add_pending_merge' its meant to handle
duplicate ids already - but its at the wrong level.

Moving that check down to set_parent_ids/set_parent_trees, and turning
it into a heads check would seem to be the most straight forward check.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080602/32b09905/attachment.pgp 


More information about the bazaar mailing list