- # -*- coding: utf-8 -*-
-
- SVN_LOOK_PATH = 'F:\\Program Files (x86)\\VisualSVN Server\\bin\\svnlook.exe'
-
- import subprocess
- import sys
- import re
-
-
- repos = sys.argv[1]
- txn = sys.argv[2]
-
- filteroutlist = ('.java','.class','.rar','.zip')
-
- #获取当前提交文件路径
- changed = subprocess.check_output([SVN_LOOK_PATH, 'changed', repos, '-t', txn])
- #sys.stderr.write('changed:%s'% changed)
- #exit(1)
- for line in changed.split('\n'):
- #sys.stderr.write('line:%s'% line)
- #exit(1)
- #获取文件的后缀名
- suffix=line[line.rfind('.'):]
- #如果获取到空值跳过
- if suffix is None:
- continue
- else:
- sys.stderr.write('suffix:%s'% suffix)
- exit(1)
复制代码 按照我的想法应该在提交报错的是时候会列出空值以外的后缀名,可我报错还是获取了空值,求教:我哪边写错了。。。
[attach]7929[/attach] |