[Python-checkins] devguide: Cover how to (un-)apply a patch.

brett.cannon python-checkins at python.org
Mon Jan 17 23:37:07 CET 2011


brett.cannon pushed 6b8b7e366d03 to devguide:

http://hg.python.org/devguide/rev/6b8b7e366d03
changeset:   111:6b8b7e366d03
tag:         tip
user:        Brett Cannon <brett at python.org>
date:        Mon Jan 17 14:36:53 2011 -0800
summary:
  Cover how to (un-)apply a patch.

files:
  faq.rst
  index.rst
  patch.rst

diff --git a/faq.rst b/faq.rst
--- a/faq.rst
+++ b/faq.rst
@@ -98,34 +98,3 @@
 
 
 .. _Pageant: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
-
-
-Patches
-=====================================================================
-
-
-How do I apply a patch?
--------------------------
-
-For the general case, to apply a patch go to the directory that the patch was
-created from (usually /dist/src/) and run::
-
-  patch -p0 < name_of_the_patch.diff
-
-The ``-p`` option specifies the number of directory separators ("/" in the
-case of UNIX) to remove from the paths of the files in the patch.  ``-p0``
-leaves the paths alone.
-
-
-How do I undo an applied patch?
--------------------------------
-
-Undoing a patch differs from applying one by only a command-line option::
-
-  patch -R -p0 < name_of_the_patch.diff
-
-Another option is to have 'patch' create backups of all files by using the
-``-b`` command-line option.  See the man page for 'patch' on the details of
-use.
-
-
diff --git a/index.rst b/index.rst
--- a/index.rst
+++ b/index.rst
@@ -115,9 +115,6 @@
     appropriately
 
 .. todo::
-    Make sure it is explained somewhere how to apply a patch
-
-.. todo::
     Go through http://docs.pythonsprints.com/core_development/ to make sure
     nothing is missing here
 
diff --git a/patch.rst b/patch.rst
--- a/patch.rst
+++ b/patch.rst
@@ -68,6 +68,14 @@
 
     svn diff > patch.diff
 
+To apply a patch generated this way, do::
+
+    patch -p0 < patch.diff
+
+To undo a patch, do::
+
+    patch -R -p0 < patch.diff
+
 
 Submitting
 ----------

--
Repository URL: http://hg.python.org/devguide


More information about the Python-checkins mailing list