File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""*Dfetch* can create a patch file with your local changes to the external project.
22
33If 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
88To generate a patch, *Dfetch* requires two revisions to identify the changes. You can
99provide these through the ``--revs`` argument.
6464
6565Updating 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``.
6972This will return the project to the state before the patch was applied. You can then stage the project and re-apply
7073the patch to the project to have an editable patch.
Original file line number Diff line number Diff line change 223223
224224Patch
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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments