@@ -37,6 +37,13 @@ from patchwork.views import generic_list
from patchwork.views.utils import patch_to_mbox
from patchwork.views.utils import series_patch_to_mbox
+try:
+ with open('/opt/patchwork/idmap.pickle', 'rb') as idp:
+ import pickle
+ lkml_idmap = pickle.load(idp)
+ idp.close()
+except:
+ lkml_idmap = {}
def patch_list(request, project_id):
project = get_object_or_404(Project, linkname=project_id)
@@ -58,6 +65,9 @@ def patch_detail(request, patch_id):
if submissions:
return HttpResponseRedirect(
reverse('cover-detail', kwargs={'cover_id': patch_id}))
+ elif int(patch_id) in lkml_idmap:
+ newurl = 'https://lore.kernel.org/patchwork/patch/%s/' % lkml_idmap[int(patch_id)]
+ return HttpResponseRedirect(newurl)
raise exc
editable = patch.is_editable(request.user)