• How to do ‘undo’ in TortoiseSVN


    In one project, I found current revision had some errors and want to come back a old revision, so I use ‘update to revision’, but It looks like it don’t work as I think.

    so how to roll back to a previous revision? en… now

    Looking at TortoiseSVN’s menu or going through the list of command-line options you’ll see … gasp! … subversion forgot a roll-back feature! How could they do that?

    http://jacwright.com/blog/75/how-to-roll-back-changes-using-subversion/

    this article tell us how to do that, but he use merge to do that. I don’t think it’s a good way, the following I will show you what I did to roll back to old version.

    There some different scenarios that need us to return back old revision.

    1) You just want an earlier version of the code to use but not commit on.
    2) You want to rewind the codebase to an earlier version and then be able to work with/commit using the earlier version as a starting point.
    3) You want to rewind the codebase to an earlier version and then be able to work with and merge the changes with one revision after the earlier version.

    Regarding the different requirements, we’ll choose different ways to handle. However, the actions that we used to use are revert to revision and update to revision 

    If you want to do 2,3, then I think revert to revision is your best choice.

    if you want to do 1, then update to revision is your choice.

    Please see the following description, you will understand why I said that. Let’s go…..

    First, we do some changes and commit it to repository.

    imageimage

    Check the revision, Now it’s 290.

    Revert to revision

    OK, we’d like to return back(Roll back) to the first revision, we look at it by selecting Tortoise SVN – > show log, And I found this revision and click Revert to this revision

    image 

    Now, we come back to previous revision, but please notice even the CONTENT of test.cxx comes back to previous revision, but the current SVN revision of this file is still current- 290. it’s very important. see

    image

    Now we change it again And commit changes. OK, it meets my requirement.

    image image

    Update to revision

    image image

    image

    Here please pay attention to this revision flag, it was 287 not current 290.

    image image

    Now, I found the CONTENT of file return back to previous. It’s ok. then we do some changes and commit it again!

    image

    You will find this error when you want to commit it. [out-of-date]

    image

    Yes, it’s correct for SVN. Because you return back to revision 287 it’s an old revision. If you want to ‘undo’, obviously you choose an error function. Don’t use update to revision to do UNDO, but use revert to revision.

    So if you insist to commit it, you have to do an update, before committing successfully.

    That’s all  I have. Enjoy it!

  • 相关阅读:
    POJ 1631 Bridging signals
    POJ 1451 T9
    企业应用架构模式阅读笔记3
    论面向服务架构设计及其应用
    软件质量属性-可测试性
    企业应用架构模式阅读笔记2
    企业应用架构模式阅读笔记1
    QTP安装与破解
    Android studio打不开,双击没有反应,已解决
    hibernate框架的基本原理及实例
  • 原文地址:https://www.cnblogs.com/king_astar/p/1677049.html
Copyright © 2020-2023  润新知