Intent of TestCommitMerge.test_merge_new_file?

Aaron Bentley aaron.bentley at utoronto.ca
Mon May 29 08:04:22 BST 2006


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

Martin Pool wrote:
| On 27 May 2006, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
| That sounds about right but I don't understand the command-line syntax.
| I would expect 'bzr graft FROM_DIR TO_DIR', where the two directories
| are presently in different branches.  (Did you mean to just say 'graft
| bar foo'?)

No, the idea I had is that you get the two source trees physically
nested using branch or checkout, etc.

$ bzr checkout ~/repo/foo foo
$ bzr checkout ~/repo/bar foo/bar
$ bzr graft ~/foo/bar foo

I think this is a clearer way of doing it than a command that says
"check out or branch this branch into this other branch, making its root
such-and-such subdirectory":


$ bzr checkout ~/repo/foo foo
$ bzr graft ~repo/bar foo/bar

The other advantage is that the reverse (a command to split a project
into two subprojects) could be very similar:

$ bzr split ~/foo/bar

| I think foo should be the name of a new or existing directory under the
| destination branch.  If it's the root of the branch, then bar will be
| grafted in at the root (similar to a merge of unrelated trees with the
| current code.)

The root directory can only have one id.  So if root ids differ between
branches, and you try to combine the root directory contents of those
branches, you'll be effectively deleting one root, and moving its files
into the other root.  This will come back to bite you when you do a
merge that adds new files to the deleted root.

~  So typical use will be 'bzr graft ../somelibrary
| ./library'.
|
| We should test that revert correctly undoes the graft as I imagine
| people will fairly often change their mind or decide to graft it
| somewhere else.

Interesting.  Given that step 4 of graft is "remove the control
directory of bar", that may be a problem.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEepz00F+nu1YWqI0RAsAjAJwLDWRZR9rxdl7E79uQd2x0w/4DKACfdGZA
vUQI9CA6+c7l5YdGM88kwSI=
=Q4Ha
-----END PGP SIGNATURE-----




More information about the bazaar mailing list