2010年1月13日星期三

get svn revision at windows command line

cmd

svn info http://svnurl > svninfo.txt
type svninfo.txt | python.exe rev.py > svnrev.txt
set /p TAG=< svnrev.txt
echo rev is %TAG%

rev.py
key="Revision:"
import sys
data = sys.stdin.readlines()
for x in data:
if x.startswith(key):
print(x[len(key):].strip())
break
need python and svn command line tool.

没有评论:

博客归档

neoedmund's shared items

我的简介

ZIP Code File