changeset 4294:e14bbd6caa34

compare: compare without 'merge' cannot span across repos - report error instead of failing
author Mads Kiilerich <madski@unity3d.com>
date Fri, 28 Jun 2013 11:50:13 +0200
parents 6c1bd918a789
children 20f051c5d814
files kallithea/controllers/compare.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/compare.py	Tue Dec 10 19:30:37 2013 +0100
+++ b/kallithea/controllers/compare.py	Fri Jun 28 11:50:13 2013 +0200
@@ -265,9 +265,6 @@
         c.statuses = c.db_repo.statuses(
             [x.raw_id for x in c.cs_ranges])
 
-        if merge and not c.ancestor:
-            log.error('Unable to find ancestor revision')
-
         if partial:
             return render('compare/compare_cs.html')
         if c.ancestor:
@@ -280,6 +277,11 @@
             rev1 = c.ancestor
             org_repo = other_repo
         else: # comparing tips, not necessarily linearly related
+            if merge:
+                log.error('Unable to find ancestor revision')
+            if org_repo != other_repo:
+                log.error('cannot compare across repos %s and %s', org_repo, other_repo)
+                raise HTTPNotFound
             rev1 = c.org_rev
 
         diff_limit = self.cut_off_limit if not c.fulldiff else None