问题
I have a revision that has been committed to SVN trunk which I would like to roll back. However, I would like to retain the changes in some fashion such as a branch or even a patch file. Any suggestions?
回答1:
Reverse-merge (I think that was the term), commit and that's all.
For the "reverse-merge" part - TSVN has this cool feature called "Revert to this revision" (and "Revert changes from this revision"), accessible through the Log dialogue.
The main purpose of a VCS is to keep history of your changes. You could always go back to this particular revision by using "Update to revision..." or by using the aforementioned "shortcuts".
回答2:
You can specify a particular revision when you do a copy (ie. branch).
Something like:
svn copy -rsome_revision trunk branches/interesting_branch
So roll back your changes in your trunk and then do your branch, specifying the revision before you commited your rollback (merge).
You can also capture the differences as a patch file, if that's what you really want to do, by redirecting the output of an svn diff
to a text file.
But that's usually not necessary, as the subversion merge commands give you this flexibility already.
来源:https://stackoverflow.com/questions/217190/how-to-quarantine-a-specific-subversion-revision