allura
Revision | 3e3bd8ce0069f7dbdebefc16c7d148b6128ebe11 (tree) |
---|---|
Time | 2011-03-10 05:26:01 |
Author | Rick Copeland <rcopeland@geek...> |
Commiter | Rick Copeland |
[#1555] Update svn so ALL last_commit_info is lazily calculated (causing test failure), fix lazy calculation (fixing test failure)
Signed-off-by: Rick Copeland <rcopeland@geek.net>
@@ -67,14 +67,14 @@ class Repository(M.Repository): | ||
67 | 67 | lc, isnew = M.LastCommitFor.upsert(repo_id=self._id, object_id=obj.object_id) |
68 | 68 | if not isnew: return lc.last_commit |
69 | 69 | try: |
70 | - info = self._svn.info2( | |
71 | - self._url + obj.path(), | |
70 | + info = self._impl._svn.info2( | |
71 | + self._impl._url + obj.path(), | |
72 | 72 | revision=self._impl._revision(obj.commit.object_id), |
73 | 73 | depth=pysvn.depth.empty)[0][1] |
74 | 74 | lc.last_commit.author = lc.last_commit.author_email = info.last_changed_author |
75 | 75 | lc.last_commit.date = datetime.utcfromtimestamp(info.last_changed_date) |
76 | - lc.last_commit.id = self._oid(info.last_changed_rev.number) | |
77 | - lc.last_commit.href = '%s%d/' % (self._repo.url(), info.last_changed_rev.number) | |
76 | + lc.last_commit.id = self._impl._oid(info.last_changed_rev.number) | |
77 | + lc.last_commit.href = '%s%d/' % (self.url(), info.last_changed_rev.number) | |
78 | 78 | lc.last_commit.shortlink = '[r%d]' % info.last_changed_rev.number |
79 | 79 | lc.last_commit.summary = '' |
80 | 80 | return lc.last_commit |
@@ -273,21 +273,6 @@ class SVNImplementation(M.RepositoryImplementation): | ||
273 | 273 | tree.object_ids = [ |
274 | 274 | Object(object_id=oid, name=name) |
275 | 275 | for name, oid in gl_tree.blobs.iteritems() ] |
276 | - # Save last commit info | |
277 | - log.debug('Save commit info for %d paths', len(infos)) | |
278 | - for i, (path, info) in enumerate(infos): | |
279 | - if i==0: | |
280 | - oid = tree_id | |
281 | - else: | |
282 | - oid = gl_tree.get_blob(path) | |
283 | - lc, isnew = M.LastCommitFor.upsert(repo_id=self._repo._id, object_id=oid) | |
284 | - if not isnew: continue | |
285 | - lc.last_commit.author = lc.last_commit.author_email = info.last_changed_author | |
286 | - lc.last_commit.date = datetime.utcfromtimestamp(info.last_changed_date) | |
287 | - lc.last_commit.id = self._oid(info.last_changed_rev.number) | |
288 | - lc.last_commit.href = '%s%d/' % (self._repo.url(), info.last_changed_rev.number) | |
289 | - lc.last_commit.shortlink = '[r%d]' % info.last_changed_rev.number | |
290 | - lc.last_commit.summary = '' | |
291 | 276 | session(tree).flush(tree) |
292 | 277 | return tree_id |
293 | 278 |
@@ -25,7 +25,7 @@ class TestRootController(TestController): | ||
25 | 25 | def test_index(self): |
26 | 26 | resp = self.app.get('/src/').follow() |
27 | 27 | assert 'svn checkout' in resp |
28 | - assert '[r4]' in resp | |
28 | + assert '[r4]' in resp, resp.showbrowser() | |
29 | 29 | |
30 | 30 | def test_feed(self): |
31 | 31 | assert 'Remove hello.txt' in self.app.get('/src/feed') |