SubWCRev 命令行

Posted on Posted in 7.subwcrev程序

SubWCRev 命令行

SubWCRev阅读工作副本中所有文件的状态,缺省会忽略外部引用。它记录找到的最高修订版本号,以及那个修订版本的提交时间戳,它也会记录在本地工作副本是否有修改,或混合的修订版本。修订版本号码,更新修订版本范围和修改状态会显示在标准输出。

SubWCRev.exe从命令行或脚本中运行,使用命令行参数控制。

SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdfe]

WorkingCopyPath是要检查的工作副本路径,你可以只对工作副本使用SubWCRev,而不是直接对版本库,这个路径可以是绝对路径,也可以是工作目录的相对路径。

如果你想让SubWCRev执行关键字替换,象版本库版本,地址等字段保存到文本文件,就需要提供一个模版文件SrcVersionFile,输出文件DstVersionFile就是模版替换之后的版本。

有几个开关影响 SubWCRev工作。如果使用多个,必须用单个组指定,例如要用-nm,不能用-n -m

表 6.1. 列出可用的命令行开关

切换 描述
-n If this switch is given, SubWCRev will exit with ERRORLEVEL 7 if the working copy contains local modifications. This may be used to prevent building with uncommitted changes present.
-m If this switch is given, SubWCRev will exit with ERRORLEVEL 8 if the working copy contains mixed revisions. This may be used to prevent building with a partially updated working copy.
-d If this switch is given, SubWCRev will exit with ERRORLEVEL 9 if the destination file already exists.
-f 如果给出这个开关,SubWCRev 就会包含文件夹的最后修改版本。默认行为是取得版本号时只考虑文件。
-e If this switch is given, SubWCRev will examine directories which are included with svn:externals, but only if they are from the same repository. The default behaviour is to ignore externals.
-x If this switch is given, SubWCRev will output the revision numbers in HEX.
-X If this switch is given, SubWCRev will output the revision numbers in HEX, with '0X' prepended.