dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #25076
Re: Reverting?
On Nov 16, 2011, at 6:09, Martin Sandve Alnæs <martinal@xxxxxxxxx> wrote:
> On 15 November 2011 22:21, Anders Logg <logg@xxxxxxxxx> wrote:
>> On Tue, Nov 15, 2011 at 10:15:43PM +0100, Martin Sandve Alnæs wrote:
>>> On 15 November 2011 22:05, Anders Logg <logg@xxxxxxxxx> wrote:
>>>> On Tue, Nov 15, 2011 at 09:51:06PM +0100, Anders Logg wrote:
>>>>> My recent work has broken the buildbot. Can anyone give a quick tip
>>>>> for how to revert the changes from the branch in such a way that I can
>>>>> reapply the changes + a proper fix later?
>>>>>
>>>>> It should be fairly quick to resolve the issue but I might as well
>>>>> learn to revert the proper way.
>>>>
>>>> I believe Marie has pushed a bug fix now, but if someone has a good
>>>> recipe please share. I can add it to the web docs for future
>>>> reference.
>>>
>>> Revert the entire state to revision 19:
>>> bzr revert -r 19
>>> bzr commit -m "Backout fix for bug #5"
>>>
>>> Revert one or more previous commits:
>>> bzr merge -r 10..9 # backs out changes from commit 10
>>> bzr merge -r 7..4 # backs out changes from commits 5,6,7
>>>
>>> From
>>> http://doc.bazaar.canonical.com/beta/en/user-guide/undoing_mistakes.html
>>>
>>> Note that the important point here is that changes that have been
>>> pushed somewhere else should be reverted or merged reversely like
>>> above, not e.g. using uncommit because that would mess up your history
>>> vs the already pushed history.
>>
>> Thanks. And how does one add back the changes once they have been
>> fixed.
>>
>> In the first case, I would do this in my local (checked out) 1.0.x:
>>
>> $ bzr revert -r 19
>> $ bzr commit -m "Backout fix for bug #5"
>>
>> Then I would fix the bug in my local 1.0.x-logg.
>>
>> How do I then get the changes from 1.0.x-logg (including the
>> changesets that were reverted) from 1.0.x-logg into 1.0.x?
>>
>> Just the usual way?
>>
>> cd 1.0.x
>> bzr merge ../1.0.x-logg
>> bzr commit -m "Proper fix for bug #5"
>
> Since 1.0.x already contains the original commit, this shouldn't work.
> You'll need to somehow record a new commit with the proper changes.
> This will depend on the situation and could be messy, but assuming you
> want to re-introduce _all_ changes that were reverted previously, you
> should be able to reverse merge the commit which contains the old
> revert :)
>
> Disclaimer: I haven't tested this yet!
>
> First:
> $ bzr revert -r 19
> $ bzr commit -m "Backout fix for bug #5"
> Say this introduces a commit -r25.
> <work work work gets us up to -r30>
>
> Then:
> $ bzr merge -r25..24 # Reverse cherry-pick the backout commit from above
> $ bzr commit -m "Re-apply old incomplete fix for bug #5"
> <work work fixing bug properly>
> $ bzr commit -m "Proper fix for bug #5"
>
>
> By the way, I don't like this sentence from the manual:
> "Unlike a normal merge, Bazaar does not currently track cherrypicks."
> Not sure what kind of trouble that may cause.
This happened when I picked some revisions from trunk to 1.0. The actual commit got lost but the files changed. I thought we would have problems merging the other way after this, but it looks like bzr has handled it.
Johan
> I recommend resolving tricky merge situations
> in a third branch which can safely be discarded,
> and inspecting the result with e.g. log, diff, missing.
>
> Martin
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help : https://help.launchpad.net/ListHelp
References