You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2020/01/28 20:16:17 UTC

[allura] 02/08: [#8333] never give option to merge *into* a tag; give ForgeHg a hook to customize tags you can merge *from*

This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit dc0e1dda6c8dffa35e1bcb66a4063594d92e1537
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Sep 16 16:17:39 2019 -0400

    [#8333] never give option to merge *into* a tag; give ForgeHg a hook to customize tags you can merge *from*
---
 Allura/allura/controllers/repository.py | 12 ++++--------
 Allura/allura/model/repository.py       |  2 +-
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 46705b0..9fdcc9b 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -161,11 +161,9 @@ class RepoRootController(BaseController, FeedController):
     def mr_widget(self):
         source_branches = [
             b.name
-            for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+            for b in c.app.repo.get_branches() + c.app.repo.get_tags(for_merge_request=True)]
         with c.app.repo.push_upstream_context():
-            target_branches = [
-                b.name
-                for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+            target_branches = [b.name for b in c.app.repo.get_branches()]
             subscribed_to_upstream = M.Mailbox.subscribed()
         return SCMMergeRequestWidget(
             source_branches=source_branches,
@@ -438,11 +436,9 @@ class MergeRequestController(object):
     def mr_widget_edit(self):
         target_branches = [
             b.name
-            for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+            for b in c.app.repo.get_branches() + c.app.repo.get_tags(for_merge_request=True)]
         with self.req.push_downstream_context():
-            source_branches = [
-                b.name
-                for b in c.app.repo.get_branches() + c.app.repo.get_tags()]
+            source_branches = [b.name for b in c.app.repo.get_branches()]
         return SCMMergeRequestWidget(
             source_branches=source_branches,
             target_branches=target_branches)
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index ece93d7..b5678bb 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -510,7 +510,7 @@ class Repository(Artifact, ActivityObject):
         """
         return self._impl.branches
 
-    def get_tags(self):
+    def get_tags(self, for_merge_request=False):
         """
         Return list of tags for the repo.