6
6
7
7
from lib import *
8
8
from git import *
9
- from git import IStream
10
- from git .test .test_commit import assert_commit_serialization
9
+ from git . base import IStream
10
+ from git .test .objects . test_commit import assert_commit_serialization
11
11
from cStringIO import StringIO
12
12
from time import time
13
13
import sys
14
14
15
15
class TestPerformance (TestBigRepoRW ):
16
-
16
+
17
17
# ref with about 100 commits in its history
18
- ref_100 = '0.1.6 '
18
+ ref_100 = 'v0.99 '
19
19
20
20
def _query_commit_info (self , c ):
21
21
c .author
@@ -45,13 +45,14 @@ def test_iteration(self):
45
45
# END for each object
46
46
# END for each commit
47
47
elapsed_time = time () - st
48
+ assert no , "Should have traversed a few objects"
48
49
print >> sys .stderr , "Traversed %i Trees and a total of %i unchached objects in %s [s] ( %f objs/s )" % (nc , no , elapsed_time , no / elapsed_time )
49
50
50
51
def test_commit_traversal (self ):
51
52
# bound to cat-file parsing performance
52
53
nc = 0
53
54
st = time ()
54
- for c in self .gitrorepo .commit (self .head_sha_2k ).traverse (branch_first = False ):
55
+ for c in self .rorepo .commit (self .head_sha_2k ).traverse (branch_first = False ):
55
56
nc += 1
56
57
self ._query_commit_info (c )
57
58
# END for each traversed commit
@@ -62,7 +63,7 @@ def test_commit_iteration(self):
62
63
# bound to stream parsing performance
63
64
nc = 0
64
65
st = time ()
65
- for c in Commit .iter_items (self .gitrorepo , self .head_sha_2k ):
66
+ for c in Commit .iter_items (self .rorepo , self .head_sha_2k ):
66
67
nc += 1
67
68
self ._query_commit_info (c )
68
69
# END for each traversed commit
@@ -73,7 +74,7 @@ def test_commit_serialization(self):
73
74
assert_commit_serialization (self .rwrepo , self .head_sha_2k , True )
74
75
75
76
rwrepo = self .rwrepo
76
- make_object = rwrepo .odb . store
77
+ make_object = rwrepo .store
77
78
# direct serialization - deserialization can be tested afterwards
78
79
# serialization is probably limited on IO
79
80
hc = rwrepo .commit (self .head_sha_2k )
0 commit comments