changeset 3386:934f1fd5d549 beta

rev_start for compare should use parents only if there are present
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 19 Feb 2013 20:47:55 +0100
parents d21c762f5c4b
children bd5420ea396b
files rhodecode/controllers/compare.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/compare.py	Tue Feb 19 20:35:25 2013 +0100
+++ b/rhodecode/controllers/compare.py	Tue Feb 19 20:47:55 2013 +0100
@@ -41,6 +41,7 @@
 from rhodecode.model.pull_request import PullRequestModel
 from webob.exc import HTTPBadRequest
 from rhodecode.lib.diffs import LimitedDiffContainer
+from rhodecode.lib.vcs.backends.base import EmptyChangeset
 
 log = logging.getLogger(__name__)
 
@@ -136,7 +137,7 @@
             # get parent of
             # rev start to include it in the diff
             _cs = other_repo.scm_instance.get_changeset(rev_start)
-            rev_start = _cs.parents[0].raw_id
+            rev_start = _cs.parents[0].raw_id if _cs.parents else EmptyChangeset()
             org_ref = ('rev', rev_start)
             other_ref = ('rev', rev_end)
             #if we cherry pick it's not remote, make the other_repo org_repo