开发者

Tortoise SVN: Reverting

开发者 https://www.devze.com 2023-04-11 13:40 出处:网络
I just reverted in the server from 511 to 510; however, even though the server is clearly working wi开发者_如何学Goth 510, the 511 is still somewhere and Tortoise SVN is considering 511 as the head ve

I just reverted in the server from 511 to 510; however, even though the server is clearly working wi开发者_如何学Goth 510, the 511 is still somewhere and Tortoise SVN is considering 511 as the head version, thus thinking there is nothing to commit. What can I do?


My reading of your question is that you want to eradicate version 511 and rollback to 510. As intimated by others, though, Subversion never forgets--there is no way to erase a revision. But you can achieve the same effect quite easily and I think a simple picture can illustrate it cleanly.

Here is a sample revision graph where you start with revision 105 as the head. The goal here is to discard not just 105 but also 104 (showing you can apply this technique to more than just the penultimate head), making 103 the new head:

  1. Start with a clean, updated, working copy at the head revision (105 in this example):
  2. Use revert to revision to rollback to the revision of interest (103 in this case).
  3. Use commit to check-in your now modified working copy and make it the new head (106 in this case).

You now have effectively rolled back to 103 by duplicating it as 106. (Or from a different perspective, you could say 103 was reincarnated as 106 :-).

Tortoise SVN: Reverting


  • You can't revert server. You work (always, with some exceptions) with WorkingCopy, changes in which relected with commit into Repo
  • Revert (svn help revert) discard your local changes and produce "pristine WC" and do nothing with repo
  • Update WC to any previous revision doesn't change repository history - history is immutable

Re-think and reformulate your task and troubles. Do you want "undo last commited revision"?


If SVN repository was reverted, or in another words was set a several revisions back - all working copies which has been updated to currently non existing revisions should be merged with new working copy (as there are no commit logging is provided by standard clients by default, maybe someone has this as an extension).

So, create new WC (in your case revision of this will be 510), and merge with one of GUI mergers changes (or just copy files) from your current WC into new one and commit the changes into new WC (all as you did when committed rev. 511), then switch to working with new WC and drop old one.


Updating to a specific revision is seldomly what you want to do. What you want to do instead is selecting a set of revisions in the log dialog, and revert these revisions (in your case revision 511). Use a clean working copy for this to avoid confusion. Tortoise SVN now reverse-merges the changes into your working copy. Up to this point the data on the server is still untouched. Now you have to commit these changes onto the server. It will appear as a new revision (512 in this case). Good practice is not to change any files and choose a proper log-message like "reverted changes from rev 511".

Subversion (and no versioning system I know of) doesn't allow deletion of revisions, so this is the way to go.


What do you want to do?

A revert is undoing local changes (in a working copy): http://svnbook.red-bean.com/en/1.1/re25.html

If you want to undo changes already commited to the repository you must do a reverse merge. In your particular case you must do: svn merge -c-511

You can read more un the "Undoing Changes" section of http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号