• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Révision3e3bd8ce0069f7dbdebefc16c7d148b6128ebe11 (tree)
l'heure2011-03-10 05:26:01
AuteurRick Copeland <rcopeland@geek...>
CommiterRick Copeland

Message de Log

[#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>

Change Summary

Modification

--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -67,14 +67,14 @@ class Repository(M.Repository):
6767 lc, isnew = M.LastCommitFor.upsert(repo_id=self._id, object_id=obj.object_id)
6868 if not isnew: return lc.last_commit
6969 try:
70- info = self._svn.info2(
71- self._url + obj.path(),
70+ info = self._impl._svn.info2(
71+ self._impl._url + obj.path(),
7272 revision=self._impl._revision(obj.commit.object_id),
7373 depth=pysvn.depth.empty)[0][1]
7474 lc.last_commit.author = lc.last_commit.author_email = info.last_changed_author
7575 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)
7878 lc.last_commit.shortlink = '[r%d]' % info.last_changed_rev.number
7979 lc.last_commit.summary = ''
8080 return lc.last_commit
@@ -273,21 +273,6 @@ class SVNImplementation(M.RepositoryImplementation):
273273 tree.object_ids = [
274274 Object(object_id=oid, name=name)
275275 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 = ''
291276 session(tree).flush(tree)
292277 return tree_id
293278
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -25,7 +25,7 @@ class TestRootController(TestController):
2525 def test_index(self):
2626 resp = self.app.get('/src/').follow()
2727 assert 'svn checkout' in resp
28- assert '[r4]' in resp
28+ assert '[r4]' in resp, resp.showbrowser()
2929
3030 def test_feed(self):
3131 assert 'Remove hello.txt' in self.app.get('/src/feed')