-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversionci.py
executable file
·30 lines (23 loc) · 996 Bytes
/
versionci.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
# Walk through specified directory and perform provided svn action
import argparse
import os
import re
from subprocess import call
from os.path import join, getsize
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--action', dest='action',help='ci|up',required=True)
parser.add_argument('--dir', dest='dir',help='directory to process',required=True)
parser.add_argument('--message', dest='message',help='message', required=False)
parser.add_argument('--username', dest='username',help='username', required=False)
args = parser.parse_args()
print (args.dir)
for root in os.listdir(args.dir):
print (args.dir + root+"\n")
if args.action == 'ci':
ci_arr = ["svn", "ci", "--message", args.message, args.dir + "/"+ root]
if args.username:
ci_arr = ["svn", "ci", "--message", args.message, args.dir + "/"+ root, "--username", args.username]
call(ci_arr)
else:
call(["svn", "up", args.dir + "/"+ root])