zoukankan      html  css  js  c++  java
  • 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!

  • 相关阅读:
    Centos下,Docker部署Yapi接口管理平台(详细得令人发指)
    Centos7下安装Docker(详细的新手装逼教程)
    性能测试之nmon对linux服务器的监控
    真爱至上,谈谈我的测试经历(二)
    linux问题点滴,给普通用户添加sudo权限
    浅谈软件测试流程(一)
    面试如何谈笑风生,软件测试基础理论整理
    测试与开发如何有效沟通,QC11(HP ALM 11)的简单使用记录
    解决github访问过慢问题
    Python语言下图像的操作方法总结
  • 原文地址:https://www.cnblogs.com/king_astar/p/1677049.html
Copyright © 2011-2022 走看看