A G
A G

Reputation: 1117

What patch format is this and how do I apply it

What patch format is this and how do I apply it?

https://code.djangoproject.com/attachment/ticket/9025/nested_inlines_2.diff

From 117e99511e0985701780ed1bcd3afd456e244ae3
     Added assertXML[Not]Equal assertions

To   015b1c15f25f2f72a40a9bfce9d91ec91ddff2a2
     Tests + revert firebug

----------------------- django/contrib/admin/options.py -----------------------
index f4205f2..58c55b0 100644
@@ -715,11 +715,16 @@ class ModelAdmin(BaseModelAdmin):
         """
         obj.delete()

-    def save_formset(self, request, form, formset, change):
+    def save_formset(self, request, formset, change):

I cannot use patch to apply it because I get the following error:

patch: **** Only garbage was found in the patch input.

A normal patch generated by diff should look like:

--- /home/user/work/django-nested-inlines-master-1/nested_inlines/admin.py  2014-09-30 14:42:23.000000000 +0100
+++ /home/user/work/django-nested-inlines-master-2/nested_inlines/admin.py  2014-03-07 20:11:35.000000000 +0000
@@ -1,4 +1,3 @@
-from django import VERSION as DJANGO_VERSION
 from django.contrib.admin.options import (ModelAdmin, InlineModelAdmin,
     csrf_protect_m, models, transaction, all_valid,
     PermissionDenied, unquote, escape, Http404, reverse)
@@ -74,7 +73,6 @@

Upvotes: 1

Views: 146

Answers (1)

das-g
das-g

Reputation: 9994

Judging by this Trac comment, this diff isn't applicable as-is, but needs some editing to become a valid patch. The file's creator later commented that he doesn't know what he did wrong, there.

117e99511e0985701780ed1bcd3afd456e244ae3 (from the diff's first line) is a valid commit ID in the django git repo. Probably, it's what the revision this change was based on. You won't find 015b1c15f25f2f72a40a9bfce9d91ec91ddff2a2 in the repo, as the diff creator didn't push his local commit and submitted the diff file instead.

If you want these changes, your best chance is probably to seek for the commit where they were applied to the django git repo (see first linked Trac comment) or to ask the people involved in the Trac ticket.

Upvotes: 2

Related Questions