+++ /dev/null
-{% extends "base.html" %}
-
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}pwclient: The Patchwork command-line client{% endblock %}
-{% block heading %}pwclient{% endblock %}
-
-{% block body %}
-<h1>pwclient</h1>
-
-<p><code>pwclient</code> is the command-line client for Patchwork. Currently,
-it provides access to some read-only features of Patchwork, such as downloading
-and applying patches.</p>
-
-<p>To use pwclient, you will need:</p>
-<ul>
- <li>The <a href="{% url 'pwclient' %}">pwclient</a>
- program (11kB, python script)</li>
- <li>(optional) a <code>.pwclientrc</code> file in your home directory.</li>
-</ul>
-
-<p>You can create your own <code>.pwclientrc</code> file. Each
-<a href="{% url 'project-list' %}">Patchwork project</a>
-provides a sample linked from the 'project info' page.</p>
-
-{% endblock %}
</table>
{% if enable_xmlrpc %}
-<p>Sample <a href="{% url 'help' "pwclient/" %}">Patchwork
-client</a> configuration for this project: <a
-href="{% url 'pwclientrc' project.linkname %}"
->.pwclientrc</a>.</p>
-{% endif %}
+<h2>pwclient</h2>
+
+<p><code>pwclient</code> is the command-line client for Patchwork. Currently,
+it provides access to some read-only features of Patchwork, such as downloading
+and applying patches.</p>
+<p>To use pwclient, you will need:</p>
+<ul>
+ <li>The <a href="{% url 'pwclient' %}">pwclient</a>
+ program (11kB, python script)</li>
+ <li>(optional) A <code><a href="{% url 'pwclientrc' project.linkname %}"
+ >.pwclientrc</a></code> file for this project, which should be stored in your
+ home directory.</li>
+</ul>
+{% endif %}
{% endblock %}
--- /dev/null
+# Patchwork - automated patch tracking system
+# Copyright (C) 2016 Stephen Finucane <stephen@that.guru>
+#
+# This file is part of the Patchwork package.
+#
+# Patchwork is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# Patchwork is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Patchwork; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from django.core.urlresolvers import reverse
+from django.test import TestCase
+
+
+class AboutViewTest(TestCase):
+
+ def test_redirects(self):
+ for view in ['help', 'help-about', 'help-pwclient']:
+ requested_url = reverse(view)
+ redirect_url = reverse('about')
+
+ response = self.client.get(requested_url)
+ self.assertRedirects(response, redirect_url, 301)
def test_get_redirect(self):
response = self.client.patch(self.url)
- self.assertRedirects(
- response, reverse('help', kwargs={'path': 'pwclient/'}))
+ self.assertRedirects(response, reverse('project-list'))
def test_invalid_method(self):
with self.assertRaises(xmlrpc_client.Fault):
from django.contrib import admin
from django.contrib.auth import views as auth_views
+from patchwork.views import about as about_views
from patchwork.views import api as api_views
from patchwork.views import bundle as bundle_views
from patchwork.views import comment as comment_views
from patchwork.views import cover as cover_views
-from patchwork.views import help as help_views
from patchwork.views import mail as mail_views
from patchwork.views import notification as notification_views
from patchwork.views import patch as patch_views
url(r'^mail/optout/$', mail_views.optout, name='mail-optout'),
url(r'^mail/optin/$', mail_views.optin, name='mail-optin'),
- # help!
- url(r'^help/(?P<path>.*)$', help_views.detail, name='help'),
+ # about
+ url(r'^about/$', about_views.about, name='about'),
+
+ # legacy redirects
+ url(r'^help/$', about_views.redirect, name='help'),
+ url(r'^help/about/$', about_views.redirect, name='help-about'),
]
if 'debug_toolbar' in settings.INSTALLED_APPS:
url(r'^project/(?P<project_id>[^/]+)/pwclientrc/$',
pwclient_views.pwclientrc,
name='pwclientrc'),
+ # legacy redirect
+ url(r'^help/pwclient/$', about_views.redirect, name='help-pwclient'),
]
if settings.ENABLE_REST_API:
# Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
+# Copyright (C) 2016 Stephen Finucane <stephen@that.guru>
#
# This file is part of the Patchwork package.
#
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from __future__ import absolute_import
-
-from django.conf import settings
-from django.http import Http404
+from django.core.urlresolvers import reverse
+from django.http import HttpResponsePermanentRedirect
from django.shortcuts import render
-help_pages = {
- '': 'index.html',
- 'about/': 'about.html',
-}
+def about(request):
+ return render(request, 'patchwork/about.html')
-if settings.ENABLE_XMLRPC:
- help_pages['pwclient/'] = 'pwclient.html'
+def redirect(request):
+ """Redirect for legacy URLs.
-def detail(request, path):
- if path in help_pages:
- return render(request,
- 'patchwork/help/' + help_pages[path])
- raise Http404
+ Remove this when Patchwork 3.0 is released.
+ """
+ return HttpResponsePermanentRedirect(reverse('about'))
@csrf_exempt
def xmlrpc(request):
if request.method not in ['POST', 'GET']:
- return HttpResponseRedirect(reverse('help',
- kwargs={'path': 'pwclient/'}))
+ return HttpResponseRedirect(reverse('project-list'))
response = HttpResponse()
<div id="footer">
<a href="http://jk.ozlabs.org/projects/patchwork/">patchwork</a>
patch tracking system | <a
- href="{% url 'help' path="about/" %}">about patchwork</a>
+ href="{% url 'about' %}">about patchwork</a>
</div>
</body>
</html>