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/02/27 13:50:59 UTC

[26/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/7c2bef4e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7c2bef4e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7c2bef4e

Branch: refs/heads/ib/7830
Commit: 7c2bef4e5554179c74da830f97c2cb1ddc030ec7
Parents: 4e28926
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Feb 26 14:20:16 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Feb 26 14:20:16 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/7c2bef4e/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):