pq: move switch_pq() to common

So that it can be re-used by the upcoming pq-rpm tool.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository: add diff_status method

This is a method of getting the filename and status information of a
diff. That is, a list of files that changed and their status, "added",
"modified" etc.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository.create_branch: add 'force' option

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
ComponentTestBase: add a per-class toplevel temp dir

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
ComponentTestBase: add check_files() method

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
ComponentTestBase: add dirs argument to _check_repo_state()

Make difference between regular files and directories, eliminating the
requirement of listing directories in the file list.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository: Implement status method

Simple wrapper to the git-status command.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp-dch: fix handling of the '--meta' option

Make it effective again - previously it was totally ignored. Also,
change it's default value to True to match the current behavior.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
notify: catch RuntimeError when importing pynotify

Work around a problem in some distros (e.g. Fedora) where "import
pynotify" crashes in RuntimeError in some cases, e.g. when DISPLAY env
variable is not set.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
log: fix auto colorizing for custom streams

Check for existence of isatty() method in the stream object. Some custom
streams (e.g. in nose) do not necessarily have this.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import-srpm: support gbp-config command

Slight refactoring of argument parsing so that the gbp-config command is
able to show the config values.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
tests: add tests for UpstreamSource.guess_version()

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import-srpm: support --upstream-vcs-tag cmdline option

Similar to what the option does in git-import-orig-[rpm].

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
WIP: import-srpm: support for patch import

Adds a new commandline option '--patch-import' for importing patches
into the source tree in packaging branch. When enabled, gbp applies and
commits all patches (not marked for manual maintenance) into the
packaging branch. If this succeeds, it also removes all imported patch
files from the packaging directory and the spec file.

Currently only supported for non-orphan-packaging.

This setting is true by default which should make more sense as the
developer wants to do code development in the packaging branch (if
he/she selects to use non-orphan packaging).

However, patch-import is force-disabled if in bare git repository. We
cannot support this, currently.

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