简体   繁体   English

从SVN命令行中提取文件的修订号

[英]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. 您好,基本上,我需要从XML中提取版本信息,我认为将整个结果都转换为XML文件,然后对其进行解析以获取修订信息。

i tried to output the svn info to a xml file by specifying 我试图通过指定将svn信息输出到xml文件

$ 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 $ svn信息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: 使用svnversion代替:

>C:\mydir>svnversion
1652:1653

You need to redirect svn info 's output to the file, the --xml option takes no parameter: 您需要 svn info的输出重定向到文件,-- --xml选项不带任何参数:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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