def svn_ver(svn_dir, do_update=True):
"""pull the latest content and get version
svn info <path> | grep "Last Changed Rev" | cut -d" " -f4
svn info --show-item last-changed-revision <path>
"""
if do_update:
cmd = 'svn up %s' % svn_dir
(cost, out, err) = Command.excute(cmd)
if len(err) > 0:
Command.logger.error('excute[%s]: %s' %(cmd, err))
cmd = 'svn info --show-item last-changed-revision %s' % svn_dir
(cost, out, err) = Command.excute(cmd)
if len(err) > 0:
Command.logger.error('excute[%s]: %s' %(cmd, err))
if len(out) > 0:
return out.strip()
else:
return ''
评论列表
文章目录