util.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:ci_scripts 作者: twotwo 项目源码 文件源码
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 ''
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号