简体   繁体   English

恢复svn的递归svn属性:ignore

[英]revert recursive svn propset of svn:ignore

I accidentally ran 我不小心跑了

svn propset svn:ignore "..." . -R

in the root directory of a huge subversion repository. 在巨大的Subversion信息库的根目录中。 Before, many folders had their individual svn:ignore properties. 以前,许多文件夹都具有各自的svn:ignore属性。

I would like to restore the state before running this "svn propset" command. 我想在运行此“ svn propset”命令之前恢复状态。 So far I did not commit the changes. 到目前为止,我尚未提交更改。 What do you suggest to do? 您建议做什么?

I thought that I might simply commit the changes and then revert the commit using merge. 我认为我可能只是提交更改,然后使用合并还原提交。 Are there possible risks that I am not thinking of? 是否有我没有想到的潜在风险? Is there a better way to undo this without even committing? 有没有更好的方法来撤销此操作甚至不提交?

Remark: I also have some local changes that are not committed yet. 备注:我还有一些尚未提交的本地更改。

If you have only file content changes I would copy the whole directory structure except .svn folders to safe place, revert everything and then copy the file contents back. 如果只更改文件内容,我会将整个目录结构(.svn文件夹除外)复制到安全位置,还原所有内容,然后再复制文件内容。

This will cause problems if you have renames in your working copy. 如果您在工作副本中有重命名,这将导致问题。

You could create a patch (without properties) of your local changes. 您可以创建本地更改的补丁(不带属性)。 Then revert everything, so that all your changes to files and properties are undone. 然后还原所有内容,以便撤消对文件和属性的所有更改。 Afterwards apply the patch again. 然后再次应用补丁。

svn diff --show-copies-as-adds --ignore-properties > filechanges.patch
svn revert -R *
svn patch filechanges.patch

I guess this should work in most cases. 我想这在大多数情况下应该可行。 Anways, I suggest to create a backup (just copy the whole project away) before doing this, in order to make sure you cannot lose any of your work. 通俗地说,我建议在执行此操作之前先创建备份(只需将整个项目复制掉),以确保您不会丢失任何工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM