簡體   English   中英

從SVN命令行中提取文件的修訂號

[英]Extracting the Revision number of a file from the SVN Command line

您好,基本上,我需要從XML中提取版本信息,我認為將整個結果都轉換為XML文件,然后對其進行解析以獲取修訂信息。

我試圖通過指定將svn信息輸出到xml文件

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

我在嘗試保存時收到錯誤消息

$ 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>

如果我跑步我不會收到錯誤

$ svn信息C:\\ Projects \\ Foo.xml --xml

幫幫我,我哪里出問題了,還建議我是否有其他方法可以提取工作副本的修訂版本號

提前致謝

使用svnversion代替:

>C:\mydir>svnversion
1652:1653

您需要 svn info的輸出重定向到文件,-- --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