Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Reversing a file deletion and keeping history

Hello,

(Using RTC 6.0.2).

One of our developers deleted files from a component and the change set was delivered in the stream.
Now we would like these files to come back into the component.
If I do a reverse from my repository workspace, applying the patch will create new files and we'll lose the previous history.
Is there any way to get the files back with their history ?

Thanks for your help,
Regards,
Marie

0 votes


Accepted answer

Permanent link

When you use the "reverse" operation, you will keep all the history ... you will see a delete in the history, followed by the version resulting from the reverse.   (I have verified this in 6.0.5, but I don't believe this behavior has changed since 6.0.2). 

Marie Michelin selected this answer as the correct answer

0 votes

Comments

Thanks for your answer Geoffrey.
I should do something wrong with my reverse because it is not working well.
Here is what I do :
1- From my repository workspace, I show the history of the component
2- From the change set, I do the reverse operation
3- It creates the patch in the pending changes view
4- I would like to restore only some files that were deleted, so I select the ones I would like to restore, and select "resolve with proposed"
5- In the Pending Changes, new "unresolved" changes appears and when I check in, it is new files and not the one I had.

What did I do wrong ?

Thanks for your help,
Regards,
Marie

 In step 4, instead of selecting the ones you want to restore, try deselecting the changes you don't want to undo, by applying the "remove from view" operation to them.   Then when all that is left is the files you want to restore, select the "auto-resolve" option.   When I do that, the "create" operation is just added to the existing history.

I'll try that but it will be really long, because it was a "cleaning" change set that removed a lot of filesn and only some of them need to be restored.
In fact, as it is not possible to select all the other files and remove them from the view, it will be a long job.
When I finish, I'll tell you if it is better.
Thanks!

I made the test (really long to remove all the changes I want to keep) and indeed it worked.
Is there any way to remove the files from the view more easily ?

Thanks for your help !

Glad to hear that it worked!   The fact that the first way you tried it didn't maintain history sounds like a bug to me, so I'd suggest filing a defect against RTC for it. 

Indeed I don't know exactly what I did that made the history lost, because I tried again with "resolve with proposed" only on the files I wanted to get back, and it worked.

Perhaps I tried with "auto resolve"...

Whatever, thanks for your help !

The only thing is that I need to select all the files in each directory. It could be long but it is better than removing the ones I don't want.

showing 5 of 6 show 1 more comments

One other answer

Permanent link
Another way to do this is to do a "rollback".

1. Discard the change-sets from your history (the ones that delete the files)
2. Right-click the component (in pending changes) and select "Replace in <stream>". That will create a baseline and roll the stream to that baseline (the component without the change-sets that deletes the files).
3. After a rollback, make sure all developers accept the incoming "replace" or discard outgoing change-sets that they didn't create themselves.

This is a less "nice" operation than the one described above, but it is actually traceable in the most recent versions of RTC, because each stream now has an "Operations history", and you can actually rollback the rollback itself, if you decide it was not a good idea.

I would in most cases recommend the "reverse" option, because it is still rolling the stream "forward" and is traceable in history. But sometimes a rollback is necessary.

/Morten

0 votes

Comments

Thanks for your help Morten, but in this case, I can't do what you propose.

Indeed :
- I don't want to remove the whole change set, only some changes in it
- and there were a lot of change set delivered after this one.

I know that reverse is not traceable, but if the new change set is well named, it is understandable. Especially if I just put back the files that were deleted.

Thank you !

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,014
× 7

Question asked: May 16 '18, 7:04 a.m.

Question was seen: 1,804 times

Last updated: Jun 07 '18, 8:42 a.m.

Confirmation Cancel Confirm