merging unrelated branches

Harald Meland harald.meland at usit.uio.no
Tue Dec 23 09:56:54 GMT 2008


[Stefan Monnier]

>>>> (you have to specify the revision range manually since there is no 
>>>> common ancestor)
>>> Once this happens, do they then have a common ancestor
>> Yes: the revision you merged (and all its ancestors) will be common.
>
> Indeed, but another issue is important: can the merge mark files from
> each branch as being "the same"?  I.e. if I have foo/bar in one branch
> and foo/bar in the other, can the merge result (via some conflict
> resolution) in Bzr knowing that these are "the same file" so that
> changes to foo/bar in either branch will be merged into the foo/bar of
> the merged branch?
> In Arch, this was easy to do by setting the arch-tag (or the
> .arch-ids/foo.id file) accordingly, but since file-identities seem to be
> kept implicit in Bazaar, it's unclear how to get this result.

You can make bazaar show the internal file-identities with e.g.

  bzr ls --show-ids

Files that have the same file-identity in both source and target
branches will be considered to be the same file by the merge.

When you merge unrelated branches, merge will use the file-identities
from these branches rather than invent new file-identites, so you can
continue merging changes in both directions.

I don't think there is any way in the CLI to set a file-id to some
explicit specified-on-the-command-line value, but you can use "bzr add
--file-ids-from=" to use the same file-id as a the same-path file in
an existing working tree.

-- 
Harald



More information about the bazaar mailing list