Sorry for all the trouble.

Andrew Stubbs <a...@codesourcery.com> writes:
> On 04/05/11 17:48, Andrew Stubbs wrote:
>> What Richard must have done is merged lp:gcc-linaro/4.6 *to* his
>> development branch, and then pushed that branch with --overwrite, thus
>> rewriting history. :(

For the record, I certainly didn't do anything involving --overwrite,
which I hadn't heard of until now.

> Just to be clear, here's the correct way to do a merge:
>
> [assuming you want to reuse an existing branch]
> bzr pull --overwrite lp:gcc-linaro/4.6
> bzr merge lp:.....whatever.....
> [...resolve-conflicts....]
> bzr resolve
> bzr commit
> bzr push lp:gcc-linaro/4.6
>
> In other words, please merge *from* development branches *to* release 
> branches.

And FWIW, this is what I thought I'd done (and what I did for other
merges that appeared to go successfully).

Specifically, I have the usual shared repo, with subdirectories for
individual branches.  So I have a gcc-linaro subdirectory that tracks
the main tree, a 4.6 subdirectory that tracks gcc-linaro/4.6, and a
subdirectory for each of my branches.

When I did the merge, I "cd"ed into the 4.6 directory and ran:

    bzr merge lp:~rsandifo/gcc-linaro/lp-714921-4.6

This appeared to work as expected.  The only changes were to
gcc/dwarf2out.c and ChangeLog.linaro, with the usual conflict
in the latter.  The change before mine in ChangeLog.linaro was
dated 2011-05-02, which is much more recent than the branch,
so that too felt "right".  (The branch was cut on 2011-04-21.)

I did the usual "bzr diff" before committing, and as expected,
the only differences were in the two files mentioned above.
So I think it really was a merge _to_ 4.6 rather than a merge
_from_ 4.6.  If it had been the other way, I'd have expected
a diff of the changes in 4.6 since I cut my branch.

However, when I tried to push the changes back, bzr told me
that the branches had "diverged".  I assumed that this was bzr's
way of telling me that someone had pushed a new revision to 4.6
while I was doing the merge.  This seemed entirely plausible --
I think there was a window of 10 minutes or more -- so I'm afraid
I didn't even question that assumption.  I'll ask now what I should
have asked yesterday: what does bzr do when there's this kind of clash?

Anyway, the bzr help page seemed to suggest that merging in the new
4.6 revision was the Right Thing to do.  I'm afraid that, once again,
it felt so natural to resolve push conflicts this way that I didn't even
question the assumption.  I did the merge, and as expected, there was
only one new commit: your change from yesterday.  So I committed the
merge and pushed again.  bzr was happy this time.  I didn't need any
special options to push.  Perhaps if I had, overdue alarm bells might
finally have rung.

Once again, I'm sorry for the screw-up.  I should have been more
circumspect.

Richard

_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to