SVN与ReviewBoard联动(3)

前面做测试,生成了很多错误的review request。
但没有找到可以批量删除的工具,于是自己写了一个。

deleterequest.py

#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
Created on 2016-11-24
@author: Hansen
获取指定svn文件夹下,指定svn版本的注释
'''

import os
import sys

#获取指定svn版本的注释
def del_rb_request(rid1,rid2):
    for rid in range(rid1,rid2):
        cmd='curl -X DELETE --header "Authorization: token API_TOKEN" http://127.0.0.1/api/review-requests/'+str(rid)+'/'
        print(cmd)
        logs = os.popen(cmd.encode()).readlines()
        for log in logs:
            print(log)

#start here
del_rb_request(0,86)

Leave a Reply

Your email address will not be published. Required fields are marked *

*