using merge to combine files from two different branches

Asked by BiDi

I have used 'merge' to pull together files from two distinct branches. I have followed the example using "bzr merge -r0..-1" described here:

http://stackoverflow.com/questions/9849466/how-to-combine-repositories-into-a-single-one-in-bazaar

, which works. However, in the new branch there is no version information about the files prior to the merge.

Is that to be expected? I was hoping that the new merged branch would carry complete version information.

Perhaps I don't understand. I am new to Bazaar.

Many thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
BiDi
Solved:
Last query:
Last reply:
Revision history for this message
John A Meinel (jameinel) said :
#1

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

On 2013-06-04 7:01, BiDi wrote:
> New question #230143 on Bazaar:
> https://answers.launchpad.net/bzr/+question/230143
>
> I have used 'merge' to pull together files from two distinct
> branches. I have followed the example using "bzr merge -r0..-1"
> described here:
>
> http://stackoverflow.com/questions/9849466/how-to-combine-repositories-into-a-single-one-in-bazaar
>
> , which works. However, in the new branch there is no version
> information about the files prior to the merge.
>
> Is that to be expected? I was hoping that the new merged branch
> would carry complete version information.
>
> Perhaps I don't understand. I am new to Bazaar.
>
> Many thanks
>
>

What do you mean by "there is no version information"? IF you use 'bzr
merge -r0..-1' I believe that after you commit the change, you will be
able to use things like 'bzr log' to see the history of the file.

Is it just that you haven't committed the merge yet?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlGtXB4ACgkQJdeBCYSNAAO8IQCeIYBFKKNrVDeuxc/8HDa4i4Bi
SekAn10QXBNC532J9Ki+RU74m20S+H55
=t3Xj
-----END PGP SIGNATURE-----

Revision history for this message
BiDi (blairdhall) said :
#2

I can only see log information about revisions subsequent to the merge (i.e., I can see the log information of each commit following the merges), but I cannot see log information for anything before that (i.e. the many revisions that took place before the merge).

I am working with a central workflow. I have two tree-less branches in the same repo (call then b1 and b2). I have corresponding checkouts on my local machine (call them dev1 and dev2). I wanted to create a combined branch with files from dev1/cf1 and dev2/cf2.

Here is what I did.

1) on the central repo I created a third branch 'bmerge' and a checkout of it on the local machine 'dev'
2) I added a single text file on dev and committed it (merge complains later if the branch is empty)
3) I did >bzr merge -r0..-1 dev1/cf1 followed by bzr commit -m"merge cf1"
4) I did >bzr merge -r0..-1 dev2/cf2 followed by bzr commit -m"merge cf2"

After all that I can see the logs of the three commits, but nothing about the revision history of the files in cf1 and cf2.

Revision history for this message
BiDi (blairdhall) said :
#3

I have tried to reproduce my problem using a simple test case with all branches and repositories located on my machine. However, in that case the problem does not occur: I do indeed get all the version history in the merged branch.

So, it seems that my difficulty might be related to the fact that I am using a repository that is located on our company file server (I have this remote drive mounted under Windows).

Revision history for this message
BiDi (blairdhall) said :
#4

OK, got it. The file server was innocent ;-)

What I had wanted to do was merge the contents of two subfolders within unrelated branches (e.g., see above: cf1 and cf2).

Bazaar did not complain when I did this, it transferred the files, but not the revision history. (Is there a reason why Bazaar should not complain about this, it certainly would have helped me if it had complained?)

It seems, however, that the first thing to do is use the command 'split', to make the subfolders into distinct trees, then proceed as before with merge.

Revision history for this message
John A Meinel (jameinel) said :
#5

It is by design that we allow you to select a subfolder to merge. I realize that having a merge not record the ancestry is a bit surprising, though.

Revision history for this message
BiDi (blairdhall) said :
#6

Actually, 'split' did not turn out to be exactly what I needed either, although it got the job done.

When I merged from the split subfolders I also got copies of files in the parent folders, which I had not wanted. I then had to do a bit of work on the merged folder to remove the unwanted files.