You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2019/09/17 19:47:56 UTC

[allura] branch db/8333 updated (3f387f3 -> 5c41fff)

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

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


    from 3f387f3  [#8333] updates to go along with ForgeHg's mercurial updates
     new d4c54cb  [#8333] never give option to merge *into* a tag; give ForgeHg a hook to customize tags you can merge *from*
     new 4b9316d  [#8333] fix logging statement
     new b3f397e  [#8333] avoid encoding issues in LastCommit.__repr__ by using the repr of the path
     new ba25b71  [#8333] fixes for tags & branches with unicode chars
     new 5c41fff  [#8333] download snapshot fixes when dirs have unicode chars

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Allura/allura/controllers/repository.py | 19 ++++++++-----------
 Allura/allura/lib/repository.py         |  4 ++--
 Allura/allura/model/repository.py       |  8 ++++----
 3 files changed, 14 insertions(+), 17 deletions(-)


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

Posted by br...@apache.org.
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 <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 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.
 


[allura] 04/05: [#8333] fixes for tags & branches with unicode chars

Posted by br...@apache.org.
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 ba25b71e733f6faed1522a5988327fa158688f16
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Sep 17 15:18:49 2019 -0400

    [#8333] fixes for tags & branches with unicode chars
---
 Allura/allura/controllers/repository.py | 1 +
 Allura/allura/lib/repository.py         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 7d3774d..99ba137 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -610,6 +610,7 @@ class CommitsController(object):
 
     @expose()
     def _lookup(self, ci, *remainder):
+        ci = unquote(ci)
         EOR = c.app.END_OF_REF_ESCAPE
         if EOR in remainder:
             i = remainder.index(EOR)
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index 6250026..60c5845 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -188,7 +188,7 @@ class RepositoryApp(Application):
             for branch in branches[:max_branches]:
                 links.append(SitemapEntry(
                     branch.name,
-                    quote(self.repo.url_for_commit(branch.name) + 'tree/')))
+                    h.urlquote(self.repo.url_for_commit(branch.name) + 'tree/')))
             if len(branches) > max_branches:
                 links.append(
                     SitemapEntry(
@@ -202,7 +202,7 @@ class RepositoryApp(Application):
             for b in tags[:max_tags]:
                 links.append(SitemapEntry(
                     b.name,
-                    quote(self.repo.url_for_commit(b.name) + 'tree/')))
+                    h.urlquote(self.repo.url_for_commit(b.name) + 'tree/')))
             if len(tags) > max_tags:
                 links.append(
                     SitemapEntry(


[allura] 03/05: [#8333] avoid encoding issues in LastCommit.__repr__ by using the repr of the path

Posted by br...@apache.org.
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 b3f397e72345e8297eb2206de1f36e3d7bc863a0
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Sep 17 14:52:01 2019 -0400

    [#8333] avoid encoding issues in LastCommit.__repr__ by using the repr of the path
---
 Allura/allura/model/repository.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 96bbfc4..7ed46f1 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1587,7 +1587,7 @@ class Blob(object):
 class LastCommit(RepoObject):
 
     def __repr__(self):
-        return '<LastCommit /%s %s>' % (self.path, self.commit_id)
+        return '<LastCommit /%r %s>' % (self.path, self.commit_id)
 
     @classmethod
     def _last_commit_id(cls, commit, path):


[allura] 05/05: [#8333] download snapshot fixes when dirs have unicode chars

Posted by br...@apache.org.
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 5c41fff54f8129841b1328b3a1cf00504114ab75
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Sep 17 15:42:28 2019 -0400

    [#8333] download snapshot fixes when dirs have unicode chars
---
 Allura/allura/controllers/repository.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 99ba137..6a72149 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -716,7 +716,7 @@ class CommitBrowser(BaseController):
         status = c.app.repo.get_tarball_status(rev, path)
         if not status and request.method == 'POST':
             allura.tasks.repo_tasks.tarball.post(rev, path)
-            redirect('tarball' + '?path={0}'.format(path) if path else '')
+            redirect('tarball' + u'?path={0}'.format(path) if path else '')
         return dict(commit=self._commit, revision=rev, status=status)
 
     @expose('json:')
@@ -776,10 +776,10 @@ class TreeBrowser(BaseController, DispatchIndex):
         tool_subscribed = M.Mailbox.subscribed()
         tarball_url = None
         if asbool(tg.config.get('scm.repos.tarball.enable', False)):
-            cutout = len('tree' + self._path)
+            cutout = len('tree' + self._path.encode('utf8'))
             if request.path.endswith('/') and not self._path.endswith('/'):
                 cutout += 1
-            tarball_url = quote('%starball' % unquote(request.path)[:-cutout])
+            tarball_url = h.urlquote('%starball' % unquote(request.path)[:-cutout])
         return dict(
             repo=c.app.repo,
             commit=self._commit,


[allura] 02/05: [#8333] fix logging statement

Posted by br...@apache.org.
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 4b9316d5727d67ad02ce57fa94f95d5eeb4ad626
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Sep 16 16:18:14 2019 -0400

    [#8333] fix logging statement
---
 Allura/allura/model/repository.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 2591059..96bbfc4 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -581,8 +581,8 @@ class Repository(Artifact, ActivityObject):
             branch = self.app.default_branch_name
         try:
             return self.commit(branch)
-        except:  # pragma no cover
-            log.exception('Cannot get latest commit for a branch', branch)
+        except Exception:
+            log.exception('Cannot get latest commit for a branch: %s', branch)
             return None
 
     def url(self):