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

Robert Collins robertc at robertcollins.net
Mon Jun 2 23:42:40 BST 2008


On Mon, 2008-06-02 at 11:12 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> | On Mon, 2008-06-02 at 00:05 -0500, John Arbash Meinel wrote:
> 
> ...
> 
> | 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
> 
> So, the attached patch does this. I haven't run the full test suite yet, which
> may show failures because of code that expected multiple merges to show up. But
> I did add explicit tests for this behavior and all WT implementations pass.
> 
> I had to get rid of the 'status' test, because it isn't possible to trigger the
> bug anymore. But the fix there was small. Certainly it seems like having
> MergeSort fail if given an empty dictionary (with a last_revision) is a bit odd.
> So I'm mostly okay with leaving the trivial fix in place.

Personally, I'd rather we didn't have little workarounds like that
cropping up - they do accumulate. If there is a workaround (e.g.
'shelve; revert; upgrade your bzr; merge again) then I think its fine to
accept that a confused tree in the wild is not fixed purely by upgrading
bzr.





> === modified file 'bzrlib/workingtree.py'
> --- bzrlib/workingtree.py	2008-05-22 05:48:22 +0000
> +++ bzrlib/workingtree.py	2008-06-02 16:09:09 +0000
> @@ -724,6 +724,25 @@
>          self._transport.put_bytes('pending-merges', '\n'.join(merges),
>              mode=self._control_files._file_mode)
>  
> +    def _filter_parent_ids_by_ancestry(self, revision_ids):
> +        """Check that all merged revisions are proper 'heads'.
> +
> +        This will always return the first revision_id, and any merged revisions
> +        which are 
> +        """

Incomplete sentence here.



bb:tweak



-- 
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/20080603/cc98119f/attachment.pgp 


More information about the bazaar mailing list