2

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

10
  • 1
    I beg your pardon? Do you want to create a revision between e.g. r2000 and r2001? Something like r2000½? Don't you just need to create a good old branch from an earlier revision? Commented Dec 27, 2017 at 10:28
  • @ÁlvaroGonzález Even if it would be the best choice, I cannot use branches in this case. But I could accept to change every version number that come after the extra commit. Commented Dec 27, 2017 at 13:12
  • It might help if we knew why branches are not appropriate here. Are you trying to accomplish something that's not strictly technical, such as making a simplified copy of your repo to be handled to some third party? Commented Dec 27, 2017 at 15:24
  • @ÁlvaroGonzález Yes, it is something like that... we are trying to duplicate our repository in a new one, identifying some release point with features that, in the first repository, were all included in a single commit. In practice, we are trying to "split" a single commit in more than one, without doing again each commit singularly in the new repository Commented Dec 27, 2017 at 15:55
  • 1
    @bahrep I'm not saying that it is fast and easy, i'm hoping there is a way to make it fast and easy.. and I'm asking to anyone that knows more than me on this topic, hoping he/she has a solution ;) To give an idea of the final result, we are talking of a total o 7k commits, and an extra 10 commits to add between them. Branching will force me to manually redo all subsequent commit. The goal is to end with a repository with only one clean branch. If this is not possible, we'll go on searching for another solution... but a question here could have solved our task in an easy way ;) Commented Dec 28, 2017 at 11:25

2 Answers 2

1

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?

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.