简体   繁体   中英

Extracting the Revision number of a file from the SVN Command line

Hello Basically i need to extract the version info from the XML I thought of puttin the entire result to a XML file and then parse it to get the revision information.

i tried to output the svn info to a xml file by specifying

$ svn info C:\Projects\Foo.xml --xml C:\Projects\FileInfo.xml

Im getting errors if i try to save

$ svn info --xml C:\Projects\Foo.xml
<?xml version="1.0"?>
<info>
<entry
   kind="dir"
   path="."
   revision="1">
<url>https://rbins.com/trunk/Projects/Foo.xml</url>
<repository>
<root>https://rbins.com/trunk/Projects/</root>
<uuid>5e7d134a-54fb-0310-bd04-b611643e5c25</uuid>
</repository>
<wc-info>
<schedule>normal</schedule>
<depth>infinity</depth>
</wc-info>
<commit
   revision="240">
<author>sally</author>
<date>2003-01-15T23:35:12.847647Z</date>
</commit>
</entry>
</info>

i do not receive error if i run

$ svn info C:\\Projects\\Foo.xml --xml

Help me where am i going wrong also suggest me if theres any alternative available to extract the revision number of the working copy

Thanks in advance

Use svnversion instead:

>C:\mydir>svnversion
1652:1653

You need to redirect svn info 's output to the file, the --xml option takes no parameter:

svn info C:\\Projects\\Foo.xml --xml > C:\\Projects\\FileInfo.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM