How to change the creation date of an existing snapshot?
Is ti possible to change the creation date of an existing snapshot?
ITeamRepository repo = ...
IBaselineSet snapshot = ...
BaselineSet workingCopy = (BaselineSet) snapshot.getWorkingCopy();
workingCopy.setCreationDate(timestamp);
IScmClient scmClient = (IScmClient) repo.getClientLibrary(IScmClient.class); // Anything like this?
scmClient.save(workingCopy, null);
Once the working copy has been updated, how can we save the item? We can't find any SCM client library...
We are going to create a lot of snapshot programmatically (from a software migration), but we need to maintain an original date, not the baselineset creation timestamp...
Thanks in advance.
Accepted answer
There is nothing on the client side which will allow you to save modifications to items like this.
Generally speaking, only server side code in the SCM component will be able to modify SCM items. There is no API to modify the creation date of a snapshot.
Sorry I don't have any suggestions for you.
Generally speaking, only server side code in the SCM component will be able to modify SCM items. There is no API to modify the creation date of a snapshot.
Sorry I don't have any suggestions for you.
Comments
There is no API to modify the creation date of a snapshot.
Not even on server side code, right?
correct.. you would be changing history
1 vote
That is correct. Baselines and snapshots are generally considered immutable once they are created. The only API to modify a snapshot is for changing the name and comment (
setBaselineSetName
and
setBaselineSetComment
on IScmService).