Skip to content

Commit 1882603

Browse files
committed
Update docs to reflect multiple patches
1 parent 2afab25 commit 1882603

6 files changed

Lines changed: 18 additions & 12 deletions

File tree

dfetch/commands/diff.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""*Dfetch* can create a patch file with your local changes to the external project.
22
33
If you've found any issues with the remote project, you can fix them within the context of your project.
4-
To help the upstream project, you can generate a patch file
5-
that can be applied by the upstream maintainer. The patch will be generated using the version control system
6-
of your main project that contains the manifest.
4+
To help the upstream project, you can generate a patch file that can be applied by the upstream maintainer.
5+
The patch will be generated using the version control system
6+
of your main project (also referred to as superproject) that contains the manifest.
77
88
To generate a patch, *Dfetch* requires two revisions to identify the changes. You can
99
provide these through the ``--revs`` argument.
@@ -64,7 +64,10 @@
6464
6565
Updating the patch
6666
======================
67-
If you have further changes to a project with a patch, you can update the patch by first reversing the patch, using
67+
If you have further changes to a project with a patch, you can create an additional patch if the changes are
68+
unrelated, or you can update the patch as described below.
69+
70+
First step is to reverse the original patch, using
6871
``apply`` and with the ``--directory`` argument as shown above. To reverse the patch you also require the ``-R``.
6972
This will return the project to the state before the patch was applied. You can then stage the project and re-apply
7073
the patch to the project to have an editable patch.

dfetch/manifest/project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@
223223
224224
Patch
225225
#####
226-
*DFetch* promotes upstreaming changes, but also allows local changes. These changes can be managed with a local patch
227-
file. *DFetch* will apply the patch file every time a new upstream version is fetched. The patch file can be specified
228-
with the ``patch:`` attribute.
226+
*DFetch* promotes upstreaming changes, but also allows local changes. These changes can be managed with local patch
227+
files. *DFetch* will apply the patch files in order every time a new upstream version is fetched. The patch file can
228+
be specified with the ``patch:`` attribute. This can be a single patch file or multiple.
229229
230230
.. code-block:: yaml
231231

dfetch/project/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def hash(self) -> str:
127127

128128
@property
129129
def patch(self) -> list[str]:
130-
"""The applied patch as stored in the metadata."""
130+
"""The list of applied patches as stored in the metadata."""
131131
return self._patch
132132

133133
@property

doc/manifest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Below an overview of all possible fields on the manifest. The bold items are man
9292
type: string
9393
patch:
9494
type: string
95-
description: Patch to apply after fetching see :ref:`Patch`.
95+
description: One or more patches to apply after fetching, see :ref:`Patch`.
9696
vcs:
9797
type: string
9898
description: Version control system used by the project. See :ref:`VCS type` for details.

doc/static/uml/update.puml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ partition "Perform Update" {
4545
:Fetch target:
4646
revision/tag/branch;
4747

48-
if (Patch given?) then (yes)
49-
:Apply patch;
48+
if (Patches given?) then (yes)
49+
while (More patches?) is (yes)
50+
:Apply next patch;
51+
endwhile (no)
5052
endif
5153
}
5254

doc/vendoring.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ They *mitigate* vendoring risks; they do not eliminate them.
254254
**Rationale** The vendored dependency may diverge, keeping it the same as upstream makes it easy to keep following
255255
upstream updates. Also by upstreaming any changes, more people outside the project can profit from any fixes.
256256
257-
*Dfetch* addresses this by providing a ``dfetch diff`` (:ref:`Diff`) command and a ``patch`` :ref:`Patch` attribute in the manifest.
257+
*Dfetch* addresses this by providing a ``dfetch diff`` (:ref:`Diff`) command and a ``patch`` (:ref:`Patch`) attribute in the manifest.
258+
This attribute can point to one or more patches that should be applied to the vendored dependency.
258259
Next to this there is a CI system to detect local changes using :ref:`Check`.
259260
260261
.. admonition :: Continuous Automation and Security Scanning

0 commit comments

Comments
 (0)