简体   繁体   中英

revert recursive svn propset of svn:ignore

I accidentally ran

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

in the root directory of a huge subversion repository. Before, many folders had their individual svn:ignore properties.

I would like to restore the state before running this "svn propset" command. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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