Remove unused import
Add issing git- prefix to --color and --notify options

Thanks: Filippo Rusconi
Closes: #693978
command_wrappers: suppress some pylint warnings

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
notifications.py: remove unused import

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository/rev_parse: use _git_inout()

instead of the deprecated _git_getoutput() method.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Support unit tests on Ubuntu: allow "ubuntu" as part of version

In tests/11_test_dch_main.py, there are checks for package names. This
change adds "ubuntu" and related release bane strings ORed in regexp
match to the patterns that are expecteds in assert statements.

Signed-off-by: Olev Kartau <olev.kartau@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
tests: make tests a Python module

Makes it possible to reuse code between various tests.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: fix "no authorship" warning messages

Add one missing string field. Show the patch filename instead of the
pull path - the user doesn't need to know if the patch was applied from
a temporary directory, for example.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: only try to parse debian/control if it exists

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import-orig: remove dead GbpNothingImported exception

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import-orig: remove dead if statement

GitRepository.commit_dir() never returns empty objects. It raises an
exception, instead.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository/get_commits: more flexible revision ranges

Support getting the complete history of an arbitrary commit-ish
(since=None, until=COMMIT-ISH). Formerly this was only possible for the
current git HEAD. Now, get_commits(since=None, until='COMMIT')
translates to 'git log COMMIT'.

Also, for consistency, add support for getting the history from an
arbitrary commit until the current HEAD (since=COMMIT-ISH, until=None).

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>
GitRepository/get_submodules: use correct path

By default, run git in the repo path, not current cwd. Also, now returns
submodule paths without leading './'.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository: allow repo inititialization from subdir

This allows initialization of a GitRepository object, even if the
current working directory (or path given to GitRepository) is not the
top level directory of the git repository.

Don't guess the git meta data dir, but, take it as reported by git
itself.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository/has_submodules: use correct .gitmodules file

Examine .gitmodules from the "root directory" of the repo, not the
current working directory. Fixes has_submodules() method, when called
from arbitrary cwd.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
GitRepository/get_commit_info: support tags

Dereference the given revision to a commit. Fixes get_commit_info() when
called for a tag.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
log: rewrite the module to use Python logging module

Replaces the Logger with a new one, derived from the Logger class of the
Python standard library. Colorized output is handled by a separate
handler class.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
log: add support for setting the color scheme

Implements changeable color schemes in the gbp.log module. Color scheme
is given as a colon-separated list, with one color for each log level:
'<debug_color>:<info_color>:<warning_colro>:<error_color>'. Colors can
be given as an integer number (ANSI terminal color code) or color name
(.e.g 'red').  Missing or empty fields are interpreted as using the
default color for that log level.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
New configuration option for setting the output color scheme

Adds a new command line and config file option 'color-scheme' for
selecting the colors used in log output.

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