Topic
  • 7 replies
  • Latest Post - ‏2007-10-16T05:07:18Z by SystemAdmin
SystemAdmin
SystemAdmin
47293 Posts

Pinned topic How to undo a rebase ?

‏2007-10-11T07:15:31Z |
Hi

I am trying to find out the possibilities of undoing a rebase.

I understand one way would be go to the changeset and delete all versions created by the rebase activity.Is that a good idea ?

Any other ways to do it?

Thanks,
Pulak
  • YannFoubert
    YannFoubert
    42 Posts

    Re: How to undo a rebase ?

    ‏2007-10-11T08:12:32Z  
    Hi,

    Did you complete the rebase? If not, just "cleartool rebase -cancel".

    If you complete the rebase, the undo will be more complex => Basically, a rebase does not create new versions, it modiifes your config spec to point to the baselines choosed for the rebase (in most of the cases the recommended baselines). Then It can generate new versions if you modified before the rebase files that are changed because of the current rebase.
    => Just removing the Change Set of the rebase activity is not enough. You have to do this and to rebase another time to the old fundation baselines that were associated with your stream.

    Regards.

    Yann
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: How to undo a rebase ?

    ‏2007-10-11T08:49:52Z  
    Hi,

    Did you complete the rebase? If not, just "cleartool rebase -cancel".

    If you complete the rebase, the undo will be more complex => Basically, a rebase does not create new versions, it modiifes your config spec to point to the baselines choosed for the rebase (in most of the cases the recommended baselines). Then It can generate new versions if you modified before the rebase files that are changed because of the current rebase.
    => Just removing the Change Set of the rebase activity is not enough. You have to do this and to rebase another time to the old fundation baselines that were associated with your stream.

    Regards.

    Yann
    Yann, since when does a rebase not create new versions?

    In mnay cases a rebase produces new versions on your dev stream, such as if you have changed a file and it has also changed on the integration stream since the base version that both are founded from.

    Best Regards,
    Graham Turnbull
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: How to undo a rebase ?

    ‏2007-10-11T09:57:54Z  
    Yann, since when does a rebase not create new versions?

    In mnay cases a rebase produces new versions on your dev stream, such as if you have changed a file and it has also changed on the integration stream since the base version that both are founded from.

    Best Regards,
    Graham Turnbull
    Hi

    @Yann

    I have completed the rebase.So can't cancel.

    @Graham

    Yes, in my case each rebase creates many versions.Those are the ones I sometimes want to do away with without any traces/hyperlinks left.
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: How to undo a rebase ?

    ‏2007-10-14T12:12:15Z  
    See ClearCase wiki:
    http://www.ibm.com/developerworks/wikis/display/cm/How+to+undo+rebase

    Frank
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: How to undo a rebase ?

    ‏2007-10-15T11:26:06Z  
    See ClearCase wiki:
    http://www.ibm.com/developerworks/wikis/display/cm/How+to+undo+rebase

    Frank
    Hi Frank

    Thanks for the wiki.But it still does not solve my problem.

    I have this requirement sometimes only when I have completed the rebase activity.So I cannot use rebase -cancel

    This wiki shows two ways.

    1. Either move all changes to another activity and remove the activity.This won't solve my problem as I want all traces of the rebase to be removed. As if the rebase never happened for all practical purposes.

    2. Or to remove the activity after deleting all version changed by the rebase activity.This can be very time consuming as I have tried this once.

    Is there any other way ?

  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: How to undo a rebase ?

    ‏2007-10-15T19:10:48Z  
    Hi Frank

    Thanks for the wiki.But it still does not solve my problem.

    I have this requirement sometimes only when I have completed the rebase activity.So I cannot use rebase -cancel

    This wiki shows two ways.

    1. Either move all changes to another activity and remove the activity.This won't solve my problem as I want all traces of the rebase to be removed. As if the rebase never happened for all practical purposes.

    2. Or to remove the activity after deleting all version changed by the rebase activity.This can be very time consuming as I have tried this once.

    Is there any other way ?

    To my knowledge, it is not possible to completely undo a rebase operation.

    A rebase does 2 things:
    • merge the baseline with the changes made on the stream (capturing the merge result in the rebase activity)
    • switch to the new baseline (by changing the configspec to the corresponding label)

    The first one can be undone by removing the versions of the change set (not by moving them to another activity) and removing the rebase activity. But I am pretty sure that UCM does not allow rebase back to the previous baseline, unless the stream does not contain any changes (i.e. there are no versions (not even a version 0) of the branchtype of the stream).

    What can you do?
    • avoid rebasing to the wrong baseline, or
    • remove the rebase activity (and the versions in its change set), create a new stream from the "old" baseline, deliver the changes to that new stream and lock-obsolete the stream that was rebased incorrectly.

    In general, many UCM operations are like history: what has happened cannot be undone.
    "If you cut your finger, you cannot uncut it but you can try to fix the damage. You can also try to teach people how not to cut themselves and be more careful."

    Good luck!

    Frank.

    TOPIC Embedded Systems
    Best, the Netherlands
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: How to undo a rebase ?

    ‏2007-10-16T05:07:18Z  
    To my knowledge, it is not possible to completely undo a rebase operation.

    A rebase does 2 things:
    • merge the baseline with the changes made on the stream (capturing the merge result in the rebase activity)
    • switch to the new baseline (by changing the configspec to the corresponding label)

    The first one can be undone by removing the versions of the change set (not by moving them to another activity) and removing the rebase activity. But I am pretty sure that UCM does not allow rebase back to the previous baseline, unless the stream does not contain any changes (i.e. there are no versions (not even a version 0) of the branchtype of the stream).

    What can you do?
    • avoid rebasing to the wrong baseline, or
    • remove the rebase activity (and the versions in its change set), create a new stream from the "old" baseline, deliver the changes to that new stream and lock-obsolete the stream that was rebased incorrectly.

    In general, many UCM operations are like history: what has happened cannot be undone.
    "If you cut your finger, you cannot uncut it but you can try to fix the damage. You can also try to teach people how not to cut themselves and be more careful."

    Good luck!

    Frank.

    TOPIC Embedded Systems
    Best, the Netherlands
    Thanks everybody for the clarity.

    I can sleep easy now as I said those very words which Frank has quoted, to a delivery lead sometime back and was wondering whether I was correct :)