From c36e8b91fb741958fc3e499c14ceb2bb718321d3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 11:49:58 +0000 Subject: [PATCH 1/7] Adjust the indentation in the HTML of the repo_branches template Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_branches.html b/pagure/templates/repo_branches.html index 5c5dab2..ef77f0b 100644 --- a/pagure/templates/repo_branches.html +++ b/pagure/templates/repo_branches.html @@ -7,101 +7,101 @@ {% block repo %}
- {% block overviewtabs %}{{ super() }}{% endblock %} + {% block overviewtabs %}{{ super() }}{% endblock %}

- Branches {{g.branches|length}} + Branches {{g.branches|length}}

{% if head %}
-
- -
- -
+
+ +
+
+
{% endif %} {% for branch in g.branches if branch != head %} -
-
- -
-
- - {% if g.repo_committer and branch != head - and ( - config.get('ALLOW_DELETE_BRANCH', True) - or repo.is_fork) %} -
- {{ g.confirmationform.csrf_token }} - - - -
- {% endif %} -
-
+
+
+ +
+
+ + {% if g.repo_committer and branch != head + and ( + config.get('ALLOW_DELETE_BRANCH', True) + or repo.is_fork) %} +
+ {{ g.confirmationform.csrf_token }} + + + +
+ {% endif %}
+
+
{% endfor %}
@@ -130,20 +130,20 @@ $(function() { {% if repo.is_fork %} html2 = ' \ - Open Pull Request \ -
'; + Open Pull Request \ +
'; {% else %} html2 = ' \ - Open Pull Request \ -
'; + Open Pull Request \ +
'; {%endif%} var _b = branch.replace(/\./g, '\\.').replace('/', '__').replace('\+', '\\+'); $('#branch-' + _b + ' .branch_del').prepend(html2); @@ -154,11 +154,11 @@ $(function() { for (branch in res.branch_w_pr){ var html = ' \ - ' - + ' Pull Request #' + res.branch_w_pr[branch].split('/').slice(-1)[0] + ' \ - '; + ' + + ' Pull Request #' + res.branch_w_pr[branch].split('/').slice(-1)[0] + ' \ + '; $('#branch-' + branch.replace(/\./g, '\\.').replace('/', '__') + ' .branch_del').prepend(html); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); From ab66293eb54c7fbb20a584d3238a76b1ea55f8f0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 11:49:58 +0000 Subject: [PATCH 2/7] Fix showing branches having unicode characters in their names Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_branches.html b/pagure/templates/repo_branches.html index ef77f0b..55698f5 100644 --- a/pagure/templates/repo_branches.html +++ b/pagure/templates/repo_branches.html @@ -39,7 +39,7 @@ {% endif %} {% for branch in g.branches if branch != head %} -
+
@@ -48,7 +48,7 @@ username=username, namespace=repo.namespace, identifier=branch) }}" - title="{{ branch }}" data-toggle="tooltip">{{ branch }} + title="{{ branch | unicode }}" data-toggle="tooltip">{{ branch | unicode }}
@@ -78,7 +78,7 @@ config.get('ALLOW_DELETE_BRANCH', True) or repo.is_fork) %}
+ onsubmit="return confirm('Are you sure you want to remove the branch: {{ branch | unicode }}?\nThis cannot be un-done!');"> {{ g.confirmationform.csrf_token }} From cc43dc50137b6ab038bc0d8f2fa4623e2e415010 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 11:49:58 +0000 Subject: [PATCH 3/7] Some more indentation fixes in the HTML of repo_branches Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_branches.html b/pagure/templates/repo_branches.html index 55698f5..0f7de20 100644 --- a/pagure/templates/repo_branches.html +++ b/pagure/templates/repo_branches.html @@ -14,96 +14,96 @@ Branches {{g.branches|length}}
- {% if head %} -
+ {% if head %} + + {% endif %} + + {% for branch in g.branches if branch != head %} + - {% endif %} - - {% for branch in g.branches if branch != head %} -
-
- -
-
- - {% if g.repo_committer and branch != head - and ( - config.get('ALLOW_DELETE_BRANCH', True) - or repo.is_fork) %} - - {{ g.confirmationform.csrf_token }} - - - - - {% endif %} +
+
+ + {% if g.repo_committer and branch != head + and ( + config.get('ALLOW_DELETE_BRANCH', True) + or repo.is_fork) %} +
+ {{ g.confirmationform.csrf_token }} + + + +
+ {% endif %}
- {% endfor %}
+ {% endfor %} +
{% endblock %} From f58de2a66865df1bc226dbdf0c9a57ade3a17045 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 11:49:58 +0000 Subject: [PATCH 4/7] Make the hook mechanism support utf-8 branch names Fixes https://pagure.io/fedora-infrastructure/issue/7229 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/__init__.py b/pagure/hooks/__init__.py index c43db65..380b2bc 100644 --- a/pagure/hooks/__init__.py +++ b/pagure/hooks/__init__.py @@ -480,10 +480,14 @@ def extract_changes(from_stdin): changes = {} if from_stdin: for line in sys.stdin: - (oldrev, newrev, refname) = line.strip().split(" ", 2) + (oldrev, newrev, refname) = str(line).strip().split(str(" "), 2) + if six.PY2: + refname = refname.decode("utf-8") changes[refname] = (oldrev, newrev) else: (refname, oldrev, newrev) = sys.argv[1:] + if six.PY2: + refname = refname.decode("utf-8") changes[refname] = (oldrev, newrev) return changes From 5aa4e89b72a2fc33991a5225953fcf266cd617e6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 11:49:58 +0000 Subject: [PATCH 5/7] Add a test for viewing a branch named ☃️ andensure it passes Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_branches.html b/pagure/templates/repo_branches.html index 0f7de20..acb8776 100644 --- a/pagure/templates/repo_branches.html +++ b/pagure/templates/repo_branches.html @@ -88,7 +88,7 @@ }}" method="post" class="icon d-inline" onsubmit="return confirm('Are you sure you want to remove the branch: {{ branch | unicode }}?\nThis cannot be un-done!');"> {{ g.confirmationform.csrf_token }} - Date: Apr 04 2019 11:49:58 +0000 Subject: [PATCH 6/7] Fix the sed command to run alembic in the tests in py2 Signed-off-by: Pierre-Yves Chibon --- diff --git a/runtests.py b/runtests.py index 74a9e13..c2ff063 100755 --- a/runtests.py +++ b/runtests.py @@ -438,7 +438,7 @@ def _run_test_suites(args, suites): "pagure/hooks/files/hookrunner" ]) subprocess.check_call([ - "sed", "-i", "-e", "s|['alembic',|['alembic-2',|", + "sed", "-i", "-e", "s|\['alembic',|\['alembic-2',|", "tests/test_alembic.py" ]) elif pyvers[0] == 3: From 2a9ce0e57469945d0890dfcdd6ae99359e20f1d0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2019 13:05:13 +0000 Subject: [PATCH 7/7] Move the pip env from python 3.4 to python 3.5 This is now required since python 3.4 has been deprecated. Signed-off-by: Pierre-Yves Chibon --- diff --git a/dev/containers/tox_py3.sh b/dev/containers/tox_py3.sh index 3ba8447..4c33d1a 100644 --- a/dev/containers/tox_py3.sh +++ b/dev/containers/tox_py3.sh @@ -22,4 +22,4 @@ echo "Last commits:" git --no-pager log -2 fi -tox -v --sitepackages -e 'py34-flask100-ci' -- --results=results +tox -v --sitepackages -e 'py35-flask100-ci' -- --results=results diff --git a/tox.ini b/tox.ini index 05b386d..59d5a88 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,34,35,36,37}-flask{100,01{1,2}} +envlist = py{27,35,36,37}-flask{100,01{1,2}} skipsdist = True