Cancel svn files by file template

I am trying to find a command (maybe bash command) to return a group of svn files.

Let's say I have some changes in my registration, and I run svn st and get this output:

 My-MacBook-2:trunk aetzioni$ svn st M SomeFolderA/src/main/java/com/mycompany/package/classA.java M SomeFolderA/main/java/com/mycompany/package/classB.java M SomeFolderB/src/main/java/com/mycompany/package/classC.java 

Now I want to find a command that does svn revert for all files under SomeFolderA .

I tried something like this:

 svn st | grep SomeFolderA | svn revert 

But this error message turned out:

 svn: Try 'svn help' for more info svn: Not enough arguments provided 
0
bash svn revert
Oct. 15 '13 at 6:56
source share
1 answer

How I did this by creating this command:

 svn st | grep SomeFolderA | awk {'print $2'} | xargs svn revert 

Explanation:

  • svn st - find all modified file
  • grep SomeFolderA - Filters svn output only to display strings having SomeFolderA
  • awk {'print $2'} - removes M at the beginning of each output line
  • xargs svn revert - the xargs command uses the output from the previous command and passes it, as it is, to the svn revert
+1
Oct. 15 '13 at 7:06 on
source share



All Articles