略微加速

略速 - 互联网笔记

svn 还原 / svn revert / Can't revert '/home/lvesu/xxx...' without reverting parent

2021-03-26 leiting (1640阅读)

标签 运维 开发编程

svn真是个古老的工具,用惯了git突然要处理一些svn老项目还真是麻烦

线上svn环境不知道被谁搞乱了,svn status看一下

[lvesu@idc-zq-kvm-web-098 newleads]$ svn status
R  +  C .
      >   local replace, incoming edit upon update
D       controllers/mobile
D       controllers/mobile/ClueDetailController.php
D       controllers/mobile/FieldMobileController.php
D       controllers/mobile/LeadsController.php
D       controllers/mobile/SearchGroupController.php
M  +    controllers/website/ClueDetailController.php
M  +    controllers/website/LeadsController.php
!       controllers/website/LeadsMobileController.php
...


真的是麻烦

本来想只管自己的文件,执行一下

svn revert -R controllers/mobile/LeadsController.php


报错:

svn: E155038: Can't revert '/home/lvesu/wwwroot/.../controllers/mobile/LeadsController.php' without reverting parent


好烦,应该是因为上级目录也被删了的关系,尝试恢复一下上级目录

[lvesu@idc-zq-kvm-web-098 controllers]$ svn revert --depth=infinity mobile


报错:

svn: E155038: Can't revert '/home/lvesu/wwwroot/.../controllers/mobile' without reverting parent


好烦,上级目录明明在,再返回一层:

[lvesu@idc-zq-kvm-web-098 controllers]$ cd ..
[lvesu@idc-zq-kvm-web-098 newleads]$ svn revert --depth=infinity .

整个世界清净了……


放个revert说明:

http://www.lvesu.com/statics/svn-book-html/svn-book.html#svn.ref.svn.c.revert


总结:revert有问题就往上级目录找,总有一级能解决[狗头]


北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3