Changeset - 8390da12aa16
[Not reviewed]
default
0 2 0
domruf - 9 years ago 2017-05-11 20:09:25
dominikruf@gmail.com
repositories: allow to pull changes from forked repo

It should be possible to pull changes not only from remote,
but also from locally forked repositories.
2 files changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/model/scm.py
Show inline comments
 
@@ -387,16 +387,16 @@ class ScmModel(object):
 

	
 
        raise Exception('Invalid scm_type, must be one of hg,git got %s'
 
                        % (scm_type,))
 

	
 
    def pull_changes(self, repo, username):
 
        """
 
        Pull from "clone URL".
 
        Pull from "clone URL" or fork origin.
 
        """
 
        dbrepo = self.__get_repo(repo)
 
        clone_uri = dbrepo.clone_uri
 
        clone_uri = dbrepo.clone_uri or dbrepo.fork and dbrepo.fork.repo_full_path
 
        if not clone_uri:
 
            raise Exception("This repository doesn't have a clone uri")
 

	
 
        repo = dbrepo.scm_instance
 
        repo_name = dbrepo.repo_name
 
        try:
kallithea/templates/admin/repos/repo_edit_remote.html
Show inline comments
 
%if c.repo_info.clone_uri:
 
%if c.repo_info.clone_uri or c.repo_info.fork:
 
<h4>
 
   ${_('Remote repository URL')}: <a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri_hidden}</a>
 
  %if c.repo_info.fork:
 
    ${_('Fork of repository')}:
 
    <a href="${h.url('summary_home',repo_name=c.repo_info.fork.repo_name)}">${c.repo_info.fork.repo_name}</a>
 
  %else:
 
    ${_('Remote repository URL')}:
 
    <a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri_hidden}</a>
 
  %endif
 
</h4>
 
${h.form(url('edit_repo_remote_update', repo_name=c.repo_name))}
 
<div class="form">
 
    <div>
 
        ${h.submit('remote_pull_%s' % c.repo_info.repo_name,
 
            _('Pull Changes from Remote Repository'),
0 comments (0 inline, 0 general)