wizard
wizard

Reputation: 1554

Manipulate SVN history

Is it possible to force SVN commit history by adding a commit prior to the last one? For example, I would "create" software version in some point of history that include only a part of the features present in later commits. Is there a way to do this?

Thank you

Upvotes: 2

Views: 303

Answers (2)

bahrep
bahrep

Reputation: 30662

The procedure you think about should not be used in normal daily workflow with SVN because the repository history in Subversion is immutable. Instead of altering the existing revisions, you should commit new ones. I do not fully understand your case, but it seems to me that you want to start with a new release branch.

I cannot use branches in this case. But I could accept to change every version number that come after the extra commit

It should be very simple to create a branch and record those changes as a series of commits instead of a single one. This should be the easiest and the correct way.

PS You can use admin tools if you have full access to the repository on the server to perform a surgery on older revisions. However, this task is not trivial and may be harmful if you do not consider all the caveats. For example, what are you going to do with svn:mergeinfo after adding revisions in between existing ones?

Upvotes: 1

alroc
alroc

Reputation: 28194

There may be a way to do it if you have direct repository access (svnadmin dump/svnadmin load) but doing will likely break every working copy checked out from your repository, the revision numbers vs. revision dates won't track properly, and it calls into question the integrity of the repository history - if you've manipulated this, what else could you have manipulated?

Find another means by which to do this, such as branching from the revision you need or reverting all changes after the point you need to modify, then re-apply them.

Upvotes: 1

Related Questions