forked from siemens/codeface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcdist.py
executable file
·56 lines (49 loc) · 2.12 KB
/
cdist.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /usr/bin/env python
# Analyse a given source code repository and
# store the resulting data structure using serialisation
# This file is part of Codeface. Codeface is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Copyright 2010, 2011 by Wolfgang Mauerer <[email protected]>
# Copyright 2012, 2013, Siemens AG, Wolfgang Mauerer <[email protected]>
# All Rights Reserved.
from codeface.VCS import gitVCS
from codeface.commit_analysis import createCumulativeSeries, createSeries
import codeface.kerninfo
git = gitVCS();
git.setRepository("/home/wolfgang/git-repos/linux-2.6/.git")
git.setRevisionRange("v2.6.14", "v2.6.33")
#git.setRevisionRange("v2.6.23", "v2.6.26")
#git.setRepository("/home/wolfgang/git-repos/perl/.git")
#git.setRevisionRange("8d063cd8450e", "HEAD")
#git.setSubsysDescription(kerninfo.subsysDescrLinux)
git.extractCommitData()
###################################################
print("Shelfing the git object")
import shelve
d = shelve.open("/home/wolfgang/linux-14-33")
d["git"] = git
d.close()
#
#print("Same in blue after unshelfing:")
#k = shelve.open("/tmp/git-shelf")
#git2 = k["git"]
#k.close()
###################################################
#res = createCumulativeSeries(git, "__main__")
#res = createCumulativeSeries(git, "block")
res = createSeries(git, subsys="__main__", revrange=["v2.6.23", "v2.6.26"])
print("Obtained a list with {0} commits".format(len(res)))
for i in range(0,10):
print("{0}: {1}, {2}".format(res[i]["commit"].cdate, res[i]["value"][0],
res[i]["commit"].getCommitMessageLines()))