Selective return to locally modified files

When returning files that have been modified locally, is there a way to exclude files? Due to circumstances beyond my control, my current workflow:

  • Create diff files that I want to include
  • svn status for a list of changes
  • svn revert, copypasting files that were included in diff
  • rm'ing residues - i.e. added files are not versioned

What I then will look something like this:

svn revert -R --exclude file1 --exclude file2 /my/path
+3
source share
2 answers

Using changelists .

Mark all files as to_revert:
$ svn changelist to_revert -R /my/path

Discard some files:
$ svn changelist --remove file1 file2

Discard tagged files only:
$ svn revert --changelist to_revert -R /my/path

+4
source

find .

find . -name .svn -prune -o -name file1 -o -name file2 -o -print0 |
    xargs -0 svn revert --
  • -name file1 ,
  • -path ./src/file1 ,
  • -path ./src/dir1 -prune .
0

Source: https://habr.com/ru/post/1790420/


All Articles