开发者

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

开发者 https://www.devze.com 2023-02-05 12:27 出处:网络
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

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 开发者_StackOverflowit 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号