How can a get a list of files in an SVN changelist with NO information except the file list?
I want a listing of files in a changelist in a format that I can use in Bash's $(). I start with svn st --cl 3011
, which lists the files but with a lot of extra junk:
Performing status on external item at 'foo'
? foo/bar
Performating status on external item at 'foo/bar'
--- Changelist '3011':
M src/math/math.cc
A src/math/determinant.cc
A src/math/determinant.h
M src/math/matrix.h
That's a lot of info to try and get sed or awk to parse through, and I'm worried I'll mess it up and end up missing a file in the changelist or adding stuff that's not in the changelist. -q doesn't help much.
Is there any way get svn to just give me src/math/math.cc src/math/determinant.cc src/math/determinant.h src/math/matrix.h
?
Thanks, Ian
svn list is most useful if you want to see what files a repository has without downloading a working copy: $ svn list http://svn.red-bean.com/repos/test/support README. txt INSTALL examples/ … For further details, see the earlier section the section called “Listing versioned directories”.
Description. Used for dividing files in a working copy into a changelist (logical named grouping) in order to allow users to easily work on multiple file collections within a single working copy.
The svn log command is used to display all the commits made on the repository or file. The svn log command is executed as follows: svn log Path.
If you want to see what changed in that revision, try pointing svn log directly at the topmost URL of your repository, as in svn log -r 2 ^/ .
This will do:
svn st --changelist 3011 | grep -v Changelist | cut -b 3-
svn st --changelist
will print the name of the changelist plus the status of the files and the file names:
--- Changelist 'cl_name':
M file1
A file2
Now you edit this by first deleting the first line with a "grep -v Changelist", which deletes the line with the word Changelist. Then do a "cut -b 3-" to delete the first few characters of each line.
With the full command, you get:
file1
file2
You don't need to use any external tools like grep
or awk
. This is actually pretty simple!
The command --ignore-externals
removes all the extra junk from the svn status
call, and you can easily merge that with --cl
parameter too:
svn st --ignore-externals --cl "Changelist Name"
That will ignore all externals, and then give you just the files in the changelist you ask for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With