Problem understanding merge
Ben Finney
bignose+hates-spam at benfinney.id.au
Sat Mar 7 12:21:51 GMT 2009
Jonathan Gossage <jgossage at magma.ca> writes:
> It looks as if I do not properly understand how merge is intended to
> work,
>
> I have a work flow that I am attempting to implement with Bazaar. I
> was doing this work flow completely by hand prior to Bazaar.
It would be good if you showed the actual commands used, and the
resulting behaviour that you find surprising.
I'll try mocking up a scenario to demonstrate what I think you're
saying.
> I start with a branch A.
$ bzr init A/
> Once A is initially populated,
$ cd A/
$ touch foo bar baz
$ bzr add
$ bzr status
added:
foo
bar
baz
$ bzr commit
$ cd ../
> a branch B is created from A.
$ bzr branch A/ B/
> Files from outside are added to B, some replacing files from A and
> some new files.
$ cd B/
$ cp /var/lib/foo ./foo
$ cp /var/lib/spam ./spam
$ bzr add
$ bzr status
added:
spam
modified:
foo
$ bzr commit
$ cd ../
> Finally a branch C is created from B and populated in the same way B
> was.
I don't know what “the same way” means. Do you mean “by a similar
process”, or do you mean “such that its contents are identical”?
I'll assume the former (i.e. that similar things are done in ‘C/’, but
with intentionally different working tree results).
$ bzr branch B/ C/
$ cd C/
$ cp /var/lib/bar ./bar
$ cp /var/lib/eggs ./eggs
$ bzr add
$ bzr status
added:
eggs
modified:
bar
$ bzr commit
$ cd ../
A o---o
\
B o---o
\
C o---o
> With the initial conditions established, I add a new file X to A and
> commit it.
$ cd A/
$ echo "hello world" > ./beans
$ bzr add
$ bzr status
added:
beans
$ bzr commit
$ cd ../
A o---o---o
\
B o---o
\
C o---o
> I then try to merge branch A into B, expecting that the file X will
> be merged from A into B.
I would expect (using ‘beans’ as the new file) the result should be:
$ cd B/
$ bzr merge ../A/
added beans
All changes applied successfully.
$ bzr commit
$ cd ../
A o---o---o----
\ \
B o---o---o
\
C o---o
> However merge says that there is nothing to do and does precisely
> that! In the general case a file entering at A may be new or may
> replace an older version. When a file in A is replaced it should be
> merged with the corresponding file in B. Once the file from B has
> been updated from A, additional manual changes may be made and
> finally the file from B should be merged into C.
You're losing me here. I think we need to see what commands you type,
and what the output is. If possible, come up with a contrived minimal
example, like mine above, that still demonstrates the behaviour you're
asking about.
--
\ “Pinky, are you pondering what I'm pondering?” “I think so, |
`\ Brain, but if it was only supposed to be a three hour tour, why |
_o__) did the Howells bring all their money?” —_Pinky and The Brain_ |
Ben Finney
More information about the bazaar
mailing list