-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeltaAny.py
More file actions
41 lines (39 loc) · 1.11 KB
/
deltaAny.py
File metadata and controls
41 lines (39 loc) · 1.11 KB
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
31
32
33
34
35
36
37
38
39
40
41
import subprocess, sys, re, time
n2s = {}
p2n = {}
n2v = {}
f = open ('RepoSize.csv')
for l in f:
ar = l .rstrip () .split(';')
vcs = ar [1]
s = int (ar [0])
n = ar [5]
if re.search ("/\.$", n):
p = re. sub('/.$', '', n)
p = 'bitbucket.org_' + p + '/' + p
else:
p = 'bitbucket.org_' + re. sub('/', '_', n)
p2n [ p ] = n
n2s [ n ] = s
n2v [ n ] = vcs
start = time .time()
now = start
nused = 0
fname = 'todo'
if len (sys .argv) > 1:
fname = sys.argv[1]
f = open (fname)
toCopy = []
for l in f:
p = l .rstrip ()
if p not in p2n:
sys.stderr.write(p + " is not found\n")
continue
n = p2n [ p ]
vcs = n2v [ n ]
cmdl = 'hg log -v --style ~audris/bin/multiline1 bb/' + p + ' | gzip > delta/' + p + '.delta.gz'
if vcs == 'git':
cmdl = 'git --git-dir=bb/' + p + ' log --numstat -M -C --diff-filter=ACMR --full-history --pretty=tformat:"STARTOFTHECOMMIT%n%H;%T;%P;%an;%ae;%at;%cn;%ce;%ct;%s" | /usr/bin/perl ~audris/bin/extrgit.perl | gzip > delta/' + p + '.delta.gz'
r = subprocess.call (cmdl, shell=True)
ttt = time .time()
print str (r) + ';' + str (ttt-start) + ';' + cmdl