rebase says "No revisions to rebase" but I think that there are some
Francis Devereux
francis at devrx.org
Thu Dec 10 11:52:51 GMT 2009
On 9 Dec 2009, at 19:31, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Francis Devereux wrote:
>> Hello,
>>
>> I have been working on a bazaar branch of a subversion for a while
>> and I
>> now want to push my changes into the subversion trunk.
>>
>> When I try "bzr push ../svn-trunk/", I get "bzr: ERROR: Operation
>> denied
>> because it would change the mainline history." which is as I would
>> expect. However, when I then do "bzr rebase ../svn-trunk/" I get "No
>> revisions to rebase.", which is not what I would expect. Can anyone
>> explain why this is happening or help me to get my changes into svn
>> without rewriting history in the svn repository (which I fear might
>> cause problems, although maybe I just need to understand some more
>> about
>> what it would do).
>>
>> Thanks,
>>
>> Francis
>>
>> P.S. here's a transcript of the commands I've used:
>>
>
Hi John, thanks for your useful reply.
> You might consider using "bzr replay" rather than "bzr rebase". I'm
> not
> sure whether "bzr rebase ../trunk" is trying to put my patches on
> trunk,
> or trunks patches on self.
I had a look at bzr replay but I couldn't figure out what it does from
"bzr help replay" and couldn't find any other docs.
> Also, you may need to update your svn trunk. (cd ../svn_trunk; bzr
> pull)
My svn trunk was up to date.
> The error about not letting you 'bzr push' is because:
>
> 1) You did bzr merge ../trunk; bzr commit rather than
> 2) cd trunk; bzr merge ../my-branch; bzr commit
I did (2) in the end and that worked to get my changes into the svn
trunk. However, they appear in the svn history as one giant commit -
I would have preferred that my individual commit messages were copied
across into svn.
> Looking at an ancestry graph, one is:
>
> A
> |\
> B C
> \|
> D
>
> versus
>
> A
> |\
> B C
> |/
> D
>
> One could argue that those are equivalent, but order-of-parents
> matters
> in bzr. It matters even more in bzr-svn. svn only mirrors the
> 'mainline'
> commits. So in SVN, you would either get:
>
> 1)
> A
> |
> C ?
> |/
> D
>
> 2)
> A
> |
> B ?
> |/
> D
>
> Since B is already in the svn repo, we can't freely change it to C.
> (The
> ? is a link that bzr-svn writes which bzr understands, but which svn
> does not.)
Thanks for that explanation.
What I was hoping is that 'cd my-branch; bzr rebase ../trunk' would re-
order the revisions in my branch to the following:
A
|
B
|
C
|
D
I would then be able to do 'cd my-branch; bzr push ../trunk" which
would push revisions C and D into the svn trunk, with full history. I
have done this before with other shorter-lived bzr branches from the
same svn trunk, and each commit that I had made in the bzr branch
ended up as a separate commit in the svn trunk. I actually suspect
that the "No revisions to rebase" response from "bzr rebase" is a bug
because I think that the revisions shown by "bzr missing" are all
revisions to be rebased. I admit that I may be confused though ;-)
Francis
More information about the bazaar
mailing list