Update Item to Revision vs Revert to Revision

后端 未结 6 654
时光说笑
时光说笑 2020-12-07 07:20

I\'ve started to use Subversion with TortoiseSVN. If I open up the log and right click on an old revision I see two options that sound like they roll back to an older versio

6条回答
  •  心在旅途
    2020-12-07 08:18

    The files in your working copy might look exactly the same after, but they are still very different actions -- the repository is in a completely different state, and you will have different options available to you after reverting than "updating" to an old revision.

    Briefly, "update to" only affects your working copy, but "reverse merge and commit" will affect the repository.

    If you "update" to an old revision, then the repository has not changed: in your example, the HEAD revision is still 100. You don't have to commit anything, since you are just messing around with your working copy. If you make modifications to your working copy and try to commit, you will be told that your working copy is out-of-date, and you will need to update before you can commit. If someone else working on the same repository performs an "update", or if you check out a second working copy, it will be r100.

    However, if you "reverse merge" to an old revision, then your working copy is still based on the HEAD (assuming you are up-to-date) -- but you are creating a new revision to supersede the unwanted changes. You have to commit these changes, since you are changing the repository. Once done, any updates or new working copies based on the HEAD will show r101, with the contents you just committed.

提交回复
热议问题