rdopkg patch(7)
===============
:doctype: manpage


NAME
----
rdopkg-feature-patch - autogenerated from feature spec `patch.feature`


SYNOPSIS
--------

Updating patches from patches branch is a core feature


SCENARIOS
---------

rdopkg patch
~~~~~~~~~~~~

* *_Given_* a distgit at Version 1.20.0 and Release 3,
* *_Given_* a patches branch with 5 patches,
* *_When_* I run rdopkg patch -l,
* *_Then_* command return code is 0,
* *_Then_* .spec file tag Release is 4%{?dist},
* *_Then_* .spec file has 5 patches defined,
* *_Then_* .spec file doesn't contain patches_base,
* *_Then_* .spec file contains new changelog entry with 5 lines,
* *_Then_* .spec file tag Release is 4%{?dist},
* *_Then_* new commit was created,
* *_Then_* git is clean,
* *_Then_* last commit message is:
....
"""
foo-bar-1.20.0-4


Changelog:
- Original Patch 5
- Original Patch 4
- Original Patch 3
- Original Patch 2
- Original Patch 1
"""
....

rdopkg patch --no-bump
~~~~~~~~~~~~~~~~~~~~~~

* *_Given_* a distgit at Version 1.20.0 and Release 3,
* *_Given_* a patches branch with 3 patches,
* *_When_* I run rdopkg patch --no-bump -l,
* *_Then_* .spec file tag Release is 3%{?dist},
* *_Then_* command return code is 0,
* *_Then_* .spec file has 3 patches defined,
* *_Then_* .spec file doesn't contain patches_base,
* *_Then_* .spec file doesn't contain new changelog entries,
* *_Then_* .spec file tag Release is 3%{?dist},
* *_Then_* new commit was created,
* *_Then_* git is clean,
* *_Then_* last commit message is:
....
"""
Updated patches from master-patches
"""
....

rdopkg patch --release-bump-index
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* *_Given_* a distgit at Version 1.20.0 and Release 1.2.3.lul,
* *_Given_* a patches branch with 1 patches,
* *_When_* I run rdopkg patch -l --release-bump-index MINOR,
* *_Then_* .spec file has 1 patches defined,
* *_Then_* .spec file contains new changelog entry with 1 lines,
* *_Then_* .spec file tag Release is 1.3.3.lul%{?dist},
* *_Then_* new commit was created

rdopkg patch without version git tag
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* *_Given_* a distgit,
* *_Given_* a patches branch with 3 patches without version git tag,
* *_When_* I run rdopkg patch -l,
* *_Then_* command return code is 1,
* *_Then_* no new commit was created,
* *_Then_* git is clean,
* *_Then_* rdopkg state file is not present,
* *_Then_* command output contains 'Invalid base patches branch git reference: '

rdopkg update-patches basic
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* *_Given_* a distgit at Version 1.0 and Release 23,
* *_Given_* a patches branch with 3 patches,
* *_When_* I run rdopkg update-patches,
* *_Then_* command return code is 0,
* *_Then_* .spec file tag Release is 23%{?dist},
* *_Then_* .spec file has 3 patches defined,
* *_Then_* .spec file doesn't contain new changelog entries,
* *_Then_* new commit was created,
* *_Then_* git is clean,
* *_Then_* rdopkg state file is not present,
* *_Then_* command output contains 'Updated patches from master-patches',
* *_Then_* command output contains 'Requested distgit update finished, see last commit.',
* *_Then_* last commit message is:
....
"""
Updated patches from master-patches
"""
....

rdopkg update-patches noop
~~~~~~~~~~~~~~~~~~~~~~~~~~

* *_Given_* a distgit,
* *_Given_* a patches branch with 0 patches,
* *_When_* I run rdopkg update-patches,
* *_Then_* command return code is 0,
* *_Then_* no new commit was created,
* *_Then_* git is clean,
* *_Then_* rdopkg state file is not present,
* *_Then_* command output contains 'No changes to patches found'

rdopkg patch --amend
~~~~~~~~~~~~~~~~~~~~

* *_Given_* a distgit with Change-Id Ideadbeef1234,
* *_Given_* a patches branch with 5 patches,
* *_When_* I run rdopkg patch -l --amend,
* *_Then_* command return code is 0,
* *_Then_* .spec file tag Release is 3%{?dist},
* *_Then_* .spec file has 5 patches defined,
* *_Then_* .spec file doesn't contain patches_base,
* *_Then_* .spec file contains new changelog entry with 5 lines,
* *_Then_* new commit was created,
* *_Then_* git is clean,
* *_Then_* last commit message is:
....
"""
foo-bar-1.2.3-3


Changelog:
- Original Patch 5
- Original Patch 4
- Original Patch 3
- Original Patch 2
- Original Patch 1


Change-Id: Ideadbeef1234
"""
....

