Cross-project merges

John Arbash Meinel john at arbash-meinel.com
Mon Jun 21 23:02:10 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lluís wrote:
> Hello there.
> 
> I'm in the need of prediodically merging a project (CEDET [1], which I'm
> migrating to bazaar), into a subdirectory of a larger project (Emacs).
> 
> What a subversion-centric developer like me would do in this case is to declare
> the CEDET subdirectory as an external dependency to a specific branch in the
> CEDET repository, but my understanding is that this is not possible with bazaar.
> 
> Then, after looking through the plugin list, I've found that merge-into [2]
> seems to provide the functionality of merging a repository into a subdirectory
> of another one. Unfortunately, it does not work with repositories using the 2a
> format [3], which is the case at hand.

This can probably be fixed if it is important. Though all merge-into
really does is:

 bzr merge ../other/project -r 0..-1
 bzr mkdir subdir
 bzr mv stuff* subdir

Which you should be able to do manually if you really need to. One bit
that merge-into would *like* to do, is to make sure to copy across the
root-id from 'other/project', which is certainly tricky to do today.

After doing the above and doing "bzr commit", it should flow pretty
easily to merge new stuff from 'other/project'. To bring stuff back from
emacs would require cherrypicking (cd other/project; bzr merge -c X
../emacs-with-project-in-subdir)

As for the specific cases you want, bzr doesn't yet track cherrypicks in
the same way that svn does. You *can* mark changes as "don't merge this
by doing":

 bzr merge ../other/branch
 bzr revert . # '.' is significant
 bzr commit -m "Mark changes merged, but superseded."

I'm not sure you can then force that revision to be manually merged
later. Versus just always being superseded. You can try "bzr merge -c X"
but I think that will just say "nothing to do".

The hack for "_byid" is to probably add a line for:

  inventory = inventory._get_mutable_inventory()

(It shouldn't be any less hackish than the existing code.)

I'm the author of merge-into, and if I get some time, I could probably
look into it.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwf4WIACgkQJdeBCYSNAANz5gCgkA6gEIYyqnsRWU8xfSvtE9nz
+sEAn1DRPUYsZTGHy77nXfw0uEePKoF4
=cmRo
-----END PGP SIGNATURE-----



More information about the bazaar mailing list