Changeset - bd5420ea396b
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-02-19 23:42:37
marcin@python-works.com
better handling of EmptyChangeset case in cherry pick pull request
2 files changed with 13 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/compare.py
Show inline comments
 
@@ -137,7 +137,7 @@ class CompareController(BaseRepoControll
 
            # 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 if _cs.parents else EmptyChangeset()
 
            rev_start = _cs.parents[0].raw_id if _cs.parents else EmptyChangeset().raw_id
 
            org_ref = ('rev', rev_start)
 
            other_ref = ('rev', rev_end)
 
            #if we cherry pick it's not remote, make the other_repo org_repo
rhodecode/model/pull_request.py
Show inline comments
 
@@ -39,6 +39,7 @@ from rhodecode.lib.utils2 import safe_un
 

	
 
from rhodecode.lib.vcs.utils.hgcompat import scmutil
 
from rhodecode.lib.vcs.utils import safe_str
 
from rhodecode.lib.vcs.backends.base import EmptyChangeset
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -180,13 +181,21 @@ class PullRequestModel(BaseModel):
 
                    'tag': 'tag',
 
                    'rev': 'id',
 
                }
 

	
 
            org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]],
 
                                         safe_str(org_ref[1]))
 
            org_rev = scmutil.revsingle(org_repo._repo,
 
                                         org_rev_spec)
 
            if org_ref[1] == EmptyChangeset().raw_id:
 
                org_rev = org_ref[1]
 
            else:
 
                org_rev = org_repo._repo[scmutil.revrange(org_repo._repo,
 
                                                          [org_rev_spec])[-1]]
 
            other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]],
 
                                           safe_str(other_ref[1]))
 
            other_rev = scmutil.revsingle(other_repo._repo, other_rev_spec)
 
            if other_ref[1] == EmptyChangeset().raw_id:
 
                other_rev = other_ref[1]
 
            else:
 
                other_rev = other_repo._repo[scmutil.revrange(other_repo._repo,
 
                                                        [other_rev_spec])[-1]]
 

	
 
            #case two independent repos
 
            if org_repo != other_repo:
0 comments (0 inline, 0 general)