Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added an svn => git changeset translator.

  • Loading branch information...
commit d2f5173a4b2342bc114eabb69e20a96caa27f090 1 parent a7cc586
@aaugustin aaugustin authored
View
1  django_website/settings/www.py
@@ -77,6 +77,7 @@
'django_website.aggregator',
'django_website.cla',
'django_website.docs',
+ 'django_website.svntogit',
'django_website.trac',
'registration',
'south',
View
0  django_website/svntogit/__init__.py
No changes.
View
17,947 django_website/svntogit/mapping.py
17,947 additions, 0 deletions not shown
View
12 django_website/svntogit/urls.py
@@ -0,0 +1,12 @@
+"""
+Legacy URLs for changesets.
+"""
+
+from __future__ import absolute_import
+
+from django.conf.urls.defaults import *
+from .views import redirect_to_github
+
+urlpatterns = patterns('',
+ (r'^(\d+)/?$', redirect_to_github),
+)
View
15 django_website/svntogit/views.py
@@ -0,0 +1,15 @@
+from __future__ import absolute_import
+
+from django.http import HttpResponsePermanentRedirect, Http404
+from .mapping import svn_to_git
+
+def redirect_to_github(request, svn_revision):
+ try:
+ git_changeset = svn_to_git[int(svn_revision)]
+ except IndexError:
+ git_changeset = None
+ if git_changeset is None:
+ raise Http404
+ github_url = 'https://github.com/django/django/commit/%s' % git_changeset
+ return HttpResponsePermanentRedirect(github_url)
+
View
1  django_website/urls/www.py
@@ -57,6 +57,7 @@
url(r'^weblog/', include('django_website.blog.urls')),
url(r'^freenode\.9xJY7YIUWtwn\.html$', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}),
url(r'^download$', flatpage, {'url': 'download'}, name="download"),
+ url(r'^svntogit/', include('django_website.svntogit.urls')),
url(r'', include('django_website.legacy.urls')),
)
Please sign in to comment.
Something went wrong with that request. Please try again.