allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 01/05: [#8333] never give option to merge *into* a tag; give ForgeHg a hook to customize tags you can merge *from*
Date Tue, 17 Sep 2019 19:47:57 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8333
in repository https://gitbox.apache.org/repos/asf/allura.git

commit d4c54cb953a4a56fe521be128a1b0bb58bcdc7be
Author: Dave Brondsema <dave@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 783af70..7d3774d 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -160,11 +160,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,
@@ -437,11 +435,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 98200fa..2591059 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -508,7 +508,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.
 


Mime
View raw message