Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put all changed files into a changelist in SVN

Tags:

svn

How can i, after running SVN status, put all files into a changelist to save copying and pasting each individual one?

like image 315
benhowdle89 Avatar asked Jan 09 '12 15:01

benhowdle89


2 Answers

Well, you can write a script to do this...

What platform are you on? Windows or Unix? What scripting language are you able to use?

Here's a real simple one I just did:

$ svn cl my-changelist $(svn st | awk '{print $2}')

It probably needs some work (what if I changed a property vs. a file or I changed both? What if I deleted a file?). But, it worked in my (admittedly simple) situation.

like image 139
David W. Avatar answered Oct 14 '22 13:10

David W.


awk's print $2 will fail if svn stat shows you flags like + or ~

cut might be safer, e.g.

svn st | cut -c9-

My bash-fu is not strong and the $() syntax didn't work for me. I ended up doing something like:

for i in `svn st | cut -c9-` do; svn changelist my-changelist $i; done
like image 23
mozboz Avatar answered Oct 14 '22 13:10

mozboz