Using Rational Team Concert or RTC: How to reverting back to a point in history?
-
26-10-2019 - |
문제
At my Work we use RTC for SCM.
This seems like a basic question for Source Control Management.
is there a way to roll back an entire workspace to a point in the past?
I have seen the history option under "team" but that seems to only be for one file.
thanks
해결책
It depends how you specify that point in the past.
If you have previous baselines that do represent said point, then, according to this thread:
If you do not have a workspace,
scm create workspace my-ws
scm workspace add-components my-ws comp1 comp2
scm accept --baseline my-baseline --source src-ws --target my-ws
scm load my-ws
If you already have a workspace:
scm workspace replace-components --baseline my-baseline my-ws workspace src-ws
다른 팁
You can also replace a component from a baseline or component in another workspace/stream via the IDE:
- in the Team Artifacts view or Pending Changes view, expand your workspace to show the components
- select the component and choose Replace With > Baseline... or Component From Another Workspace or Stream...
If you want to replace multiple components at once, you can:
- open the workspace editor (choose Open on the workspace)
- in the Components section, click Add...
- choose the source (baseline, workspace/stream, or snapshot) and which component(s)
- when warned that the selected components are already in the workspace, click OK to replace
- save
Or, if you don't have a baseline or other workspace/stream capturing the point in the past you want, you can:
- select the component (in the TA or PC view)
- choose Show > History (this shows the entire change history for the component, not just for a specific file)
- select the recent change sets that you don't want
- choose Discard...
If you don't have a baseline, you can also discard the change sets that have been delivered to the stream since the time you care about.
You do that by calling scm discard <change-set-selector>
. To find the change sets to discard, use scm history
.
You mentioned you want to revert an entire workspace... Just to clear up what you're asking: Changes are checked-in to a repository workspace. Checked-in changes are delivered to a stream. Differing from some SCM systems in that there is a two step process.
Do you want to revert to a prior state in your workspace? or the steam?
Reverting a changeset delivered to a stream is easy, IBM actually has some decent doco on it.
If you checked in a change to your workspace but didn't deliver... it's going to be rougher, best you can hope for is restoring from local history in your IDE. The repository workspace doesn't store history.
The answer below will help you only if you want to revert to the last checked version.
In the RTC IDE:
- Go to the Pending Changes tab
- Right click on the folder/s that you want to rollback
- Undo
Check the Image below :)