Reputation: 21
I want to get list of files with full path from SVN repository.
By using the command(svn list -R 192.0.0.0/Project/BRANCH1
) . I am getting list of files with full path but it is displaying as parentfolder
then parentfolder/subfolder
.
For example , I have svn repository as 192.0.0.0/Project/BRANCH1
In that Branch1 I have file like success.jsp
. By using the command(svn list -R 192.0.0.0/Project/BRANCH1
)
It is displaying as BRANCH1/
then
BRANCH1/success.jsp
.
Here i want simply as BRANCH1/success.jsp
.
Also I used (svn list) command to get list of files but,
It is simply displaying as the folder name of the filebranch (BRANCH1
) not that jsp page name. It is displaying as BRANCH1
I want to display as BRANCH1/success.jsp
Could you please any one help me to get list of files from svn with full path by using svn commands.
Upvotes: 2
Views: 2136
Reputation: 50034
Maybe the following command line already helps you. It removes all lines from the output, that end with the character '/', i.e. it removes directories.
svn ls -R | grep -v '/$'
If you need more control, I recommend using the option --xml
and processing the output with a script. For example, the following python script prints the full pathname of all files, when invoked with svn ls -R --xml | /tmp/filter.pz
:
#! /usr/bin/env python3
import sys, lxml.etree
document = lxml.etree.parse(sys.stdin.buffer)
for entry in document.xpath('//entry[@kind="file"]'):
print(entry.xpath('string(name)'))
Upvotes: 1