The question:
How do I commit changes "in between two revisions"?
I'm using quotation marks because obviosly you cannot really commit anything between two revisions - they already are in repository.
The long story, i.e. why do I need this?
The question might sound awkward at first but here's a real life scenario I did encounter in my work.
We are committing development-time changes to development branches (or 'feature branches', fb's, as we also call them) and when work is done we merge to trunk.
You know, the basic workflow.
From trunk we release our SW, and we agree to have a code freeze certain days before actual release.
Now, I was foolish enough to trust our release candidate (RC) built from trunk is good since all automated tests had passed and committed a merge to trunk before we actually released the SW. And removed the feature branch.
Let's say the release candidate was in revision 42 and the version of SW we release is v1.0.3. So, r42 is RC for release v1.0.3.
So, RC looked good but before we released the SW I committed r43 to trunk. All tests in CI passed so I went and deleted branch fb14 (revision 44).
Turned out that RC wasn't good after all and needed fixing, but v1.0.3 must not contain feature 14 (implemented in fb14), i.e. r43.
The same in a sort of illustrated form:
==r42=======r43
^ /
| /
| fb14
|
commit fix there to get new RC
So I need to bring r42 back, commit something and then bring r43 back.
Ok, this is easy, right? Roll back to r42:
svn merge -r HEAD:42 .
svn commit -m "Reverted back to RC of v1.0.3"
Implement the needed fix and
svn commit -m "Fixed b0rken feature for v1.0.3"
Then we'll release the SW and I'll bring r43:
svn up
svn merge -c 43 .
But wait, this doesn't do anything! I went and deleted branch fb14 so do I need to dig that back from svn and merge it to trunk again? Surely I must be able to bring r43 somehow back.
So I kind of want this:
roll back to r42
-------------
/ \
==r42=====r43=====r45=====r46=====r47
/ \ ^ /
merge/ \ | /
/ \ fix /
fb14 \ /
| -------------
| bring back changes from r43
|
deleted in r44
EDIT: Boo, he's answering his own question!
Read https://stackoverflow.blog/2011/07/01/its-ok-to-ask-and-answer-your-own-questions/
I want to find this later if/when I encounter similar situation again.