changeset 6663:8390da12aa16

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.
author domruf <dominikruf@gmail.com>
date Thu, 11 May 2017 20:09:25 +0200
parents 182f46d62ab4
children 5efcfe4dd259
files kallithea/model/scm.py kallithea/templates/admin/repos/repo_edit_remote.html
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/scm.py	Tue May 30 02:59:45 2017 +0200
+++ b/kallithea/model/scm.py	Thu May 11 20:09:25 2017 +0200
@@ -390,10 +390,10 @@
 
     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")
 
--- a/kallithea/templates/admin/repos/repo_edit_remote.html	Tue May 30 02:59:45 2017 +0200
+++ b/kallithea/templates/admin/repos/repo_edit_remote.html	Thu May 11 20:09:25 2017 +0200
@@ -1,6 +1,12 @@
-%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">