You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/03/06 13:35:31 UTC

[24/26] allura git commit: [#7830] ticket:733 Temporary fix for the case when downstream repo has no new commits from upstream

[#7830] ticket:733 Temporary fix for the case when downstream repo has no new commits from upstream

In the case of Mercurial, log raises Exception. It might happen after automerge
of merge request. Will be fixed more rigorously in [#7836].


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5f206d61
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5f206d61
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5f206d61

Branch: refs/heads/ib/7830
Commit: 5f206d61f5d116ddd9ab0f9654318a7254df3936
Parents: facc4c0
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Feb 26 14:20:16 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Fri Mar 6 09:43:10 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5f206d61/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index d866598..867a6d2 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -775,10 +775,16 @@ class MergeRequest(VersionedArtifact, ActivityObject):
                 commit = rev._id
             else:
                 commit = self.app.repo.head
-            return list(c.app.repo.log(
-                self.downstream.commit_id,
-                exclude=commit,
-                id_only=False))
+            try:
+                return list(c.app.repo.log(
+                    self.downstream.commit_id,
+                    exclude=commit,
+                    id_only=False))
+            except Exception:
+                log.exception(
+                    "Can't get commits for merge request",
+                    self.url())
+                return []
 
     @classmethod
     def upsert(cls, **kw):