Fix Pylint Error

C0301: Line too long
C0326: No space allowed around keyword argument assignment
C0326: Exactly one space allowed before assignment

Change-Id: Ie40818628a51c0d52ec6b9bd3ad062c0caee9209
conf: make it possible to add new sections

Change the set_into_file() method so that a new section is added if the
desired section is not found in the config.

Change-Id: Ic4c513bd07b0b7ce8a82b921faba35ed36befef5
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
conf: make it possible to update an empty conf file

Change-Id: Ifdc0fc88424a10500749d74fa1784eeea7012031
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Implement 'devel' subcommand

This command is to support another development model where packaging
files are maintained in a separate branch and source code changes in
separate development branch(es). The devel command is designed for
managing these development branches.

The subcommand provides the following actions:
1. gbs devel start: initialize development branch
2. gbs devel export: export patches from development branch back onto
                     the packaging branch
3. gbs devel drop: delete the development branch
4. gbs devel switch: switch between packaging and development branches
5. gbs devel convert: convert a package from the "old single branch"
                      development model to the new model

Change-Id: I2eec2b2ed73f50e03a9f7a2e5f6d24fc765c3a5b
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
export: drop one unused internal function argument

The force_native argument of create_gbp_export_args() is not used
anywhere, anymore.

Change-Id: I1c5659904caf5b0dd22c55fac4e5122f4e76c0f7
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
export: support for the new development/* branches

Export now detects the package maintenance model (separate packaging and
devel branches or the old single packaging branch) from the local
.gbs.conf and available branches. If an orphan branch (no common history
with the upstream branch) patch export is disabled and packaging files
are taken as is from the branch. If gbs detects from the local .gbs.conf
that the current branch is a development branch the packaging files are
taken from the packaging branch, but, patches are generated from the
development branch.

Change-Id: Ic7b782480a36792ae5ae55f8159a6850d894799a
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
build: support for the new development/* branches

The build now detects the package maintenance model (separate packaging
and devel branches or the old single packaging branch).

Change-Id: I2e2d22a7582e1c9e70182eea6ce2c3f1f6b97ad5
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import: add --orphan-packaging option

This option causes packaging files to be imported into an orphan branch
which has no common history with the upstream branch. Patches are not
applied either, but, packaging files are imported "as is". The new
options is for supporting the new package maintenance model which has
separate branches for packaging files and source code development. After
importing a source package with this option, a development branch can be
created with "gbs devel start".

NOTE! The new option is only valid for implementing source rpms - no
effect when importing upstream tarballs.

Change-Id: Ib7004ccacf8bc15a9935ade60910a74c577893cb
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
devel: implement --retain-history option

With this option defined gbs tries to preserve the history of the
changes (since upstream) doing a convert. Basically, for each commit in
the old branch a corresponding commit in the new orphan packaging branch
is created. This works by dumping packaging files and updating patches
for each commit.  However, empty commits are not generated - these are
caused e.g. by changes files that are ignored by patch-generation like
.gbs.conf.

NOTE! Only valid for the 'convert' action.

Change-Id: I669fa6732bea7940561f5c99820d6d97d14b0658
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
packaging: drop unneeded build requirement

Change-Id: I89aad41d263af14f21736622bce0105e63c9e9bd
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com>
changelog: utilize rpm-ch from git-buildpackage

Start to use the gbp changelog tool as backend as it is more
feature-rich. For example, it automatically parses bug-tracking-system
meta-tags from the commit messages (i.e. "Closes: XYZ" etc) and has a
lot more intelligent start-commit guessing.

Later on, additional features from gbp can be enabled in gbs, too.

Creating a new changelog from scratch now requires giving the --since
option. Previously gbs would take the whole git history to the changelog
which is problematic - e.g. creating a new changelog for linux kernel
would take every commit from the linux git history which is *very* long.

Also, the order of entries (i.e. commits) in the new changelog section
is now reversed: the oldest commit will be first (topmost) in the list
and the newest commit will be at the bottom of the list. This should
make the changelog a better chronological read.

Change-Id: Ib4f02f9be95f869b2161d16f8b68f828c5c1deda
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add the missed 'cmd_devel.py' in gbs/debian/gbs.install

Change-Id: I5d66b93c4d7580173605db17b8f56cbd3ea38a80
Signed-off-by: Li Jinjing <jinjingx.li@intel.com>
export: fix bug in generation of gbp cmdline options

Always give '--git-export' option to git-buildpackage-rpm. This bug was
introduced when enabling the support for development branches.

Change-Id: I48daf69723979b04dbb6f12304e5dcb20666b44a
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
submit: refuse to submit from development branch

The submit command now detects if the submission is done from the
development branch of an orphan packaging branch and fails in this case.
Submissions must be done from the packaging branch if the package is
maintained using the orphan-packaging model.

Change-Id: I8fdfe9c64f1e71b1d8e1a5cdfa1ad63e93378b75
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
docs: documention for the new orphan-packaging maintenance model

Document the new 'devel' subcommand and the related package maintenance
model and Git branching layout.

Change-Id: I8ee145cbe96efea86b588ece561218425eca3bf5
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
docs: update section about package maintenance models

Especially, improve documentation regarding the orphan-packaging model.

Change-Id: I11b320d1b1cea6a683377fd23b1a35fdead9118f
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
changelog: implement '--all' cmdline option

For using all commits from the Git history. Overrides the '--since'
option, in case both are defined.

Fixes: #1829

Change-Id: I5ebfcb2e14396725067b64d6756f97af5928c22b
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Supporting new profile key 'exclude_packages'

Tizen packages always have dependencies circles, and current gbs
does not support building multiple packages with circles. so
developer have to use --exclude option to exclude them every build
time.

This patch introduce exclude_packages to make user can configure
it in profile section.

Fixes: #1882

Change-Id: I3ab52fe2e405e0ebc009d14d230af8d3a638a4a7
Rename "Maintenance Models" section to better reflect the theme

Change-Id: Ib119d538d4e104bff5e5304583a9eb6f46ba08d6
changelog: fix import of the gbp changelog module

After it was renamed in gbp.

Change-Id: Ic66e16c672ec1ba42ab660c20225a87975fb9b0d
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>