tools/git-buildpackage.git
11 years agoGit.Repository.__git_inout: Close all other file descriptors
Guido Günther [Sat, 29 Jun 2013 10:38:42 +0000 (12:38 +0200)]
Git.Repository.__git_inout: Close all other file descriptors

No need to leak fds to the child.

11 years agoGit.Repository.__git_inout: properly set stdin
Guido Günther [Sat, 29 Jun 2013 10:38:42 +0000 (12:38 +0200)]
Git.Repository.__git_inout: properly set stdin

We should set stdin to subprocess.PIPE when piping input according
to the subprocess docs.

11 years agoUse has_key
Guido Günther [Thu, 27 Jun 2013 17:14:38 +0000 (19:14 +0200)]
Use has_key

It's shorter and get's rid of the unused dummy variable.

11 years agoDocument gbp's help option
Guido Günther [Thu, 27 Jun 2013 17:08:59 +0000 (19:08 +0200)]
Document gbp's help option

11 years agoDocument changes and release 0.6.1 debian/0.6.1
Guido Günther [Thu, 27 Jun 2013 09:23:09 +0000 (11:23 +0200)]
Document changes and release 0.6.1

11 years agoDepend on python-pkg-resources
Guido Günther [Thu, 27 Jun 2013 07:36:10 +0000 (09:36 +0200)]
Depend on python-pkg-resources

Closes: #714238

11 years agoSplit {Build-,}Deps per line
Guido Günther [Thu, 27 Jun 2013 07:34:46 +0000 (09:34 +0200)]
Split {Build-,}Deps per line

and sort alphabetically

11 years agoDocument changes and release 0.6.0 debian/0.6.0
Guido Günther [Wed, 26 Jun 2013 14:39:55 +0000 (16:39 +0200)]
Document changes and release 0.6.0

11 years agoimport-dsc: print filename instead of object name
Guido Günther [Wed, 26 Jun 2013 17:14:32 +0000 (19:14 +0200)]
import-dsc: print filename instead of object name

11 years agoconfig: Don't fill in the parser with all defaults
Guido Günther [Wed, 26 Jun 2013 16:43:49 +0000 (18:43 +0200)]
config: Don't fill in the parser with all defaults

There's no need to fill the parser with all the built in defaults since
we can simply copy them to the config from the class dict. This allows
us to first set the values from the old {git,gbp}-* commands and then
only overwrite changed values from the newer "gbp <command>" versions.

Otherwise we'd overwite all old style config with the new style one.
This also fixes the problem where the default section wouldn't be read
at all if the command doesn't even have an empty section in any gbp.conf
file.

11 years agoFix typo
Guido Günther [Wed, 26 Jun 2013 16:36:20 +0000 (18:36 +0200)]
Fix typo

Git-Dch: Ignore

11 years agogbp-import-dscs: invoke gbp import-dsc
Guido Günther [Wed, 26 Jun 2013 16:01:09 +0000 (18:01 +0200)]
gbp-import-dscs: invoke gbp import-dsc

instead of git-import-dsc

11 years agoConsistently call gbp the supercommand
Guido Günther [Wed, 26 Jun 2013 15:15:19 +0000 (17:15 +0200)]
Consistently call gbp the supercommand

and robustify against invalid modules names.

11 years agogbp: support --help
Guido Günther [Wed, 26 Jun 2013 14:59:52 +0000 (16:59 +0200)]
gbp: support --help

11 years agoUpdate package description
Guido Günther [Wed, 26 Jun 2013 11:47:42 +0000 (13:47 +0200)]
Update package description

11 years agoNEWS: add a note about the new gbp super command
Guido Günther [Wed, 26 Jun 2013 11:44:26 +0000 (13:44 +0200)]
NEWS: add a note about the new gbp super command

11 years agoRename the sgml files from git- to gbp-
Guido Günther [Wed, 26 Jun 2013 11:32:32 +0000 (13:32 +0200)]
Rename the sgml files from git- to gbp-

11 years agogbp.conf: Use command names instead of {git,gbp}-
Guido Günther [Wed, 26 Jun 2013 11:28:26 +0000 (13:28 +0200)]
gbp.conf: Use command names instead of {git,gbp}-

11 years agodocs: Rename the entities from &git-<command>; to &gbp-<command>;
Guido Günther [Wed, 26 Jun 2013 11:09:51 +0000 (13:09 +0200)]
docs: Rename the entities from &git-<command>; to &gbp-<command>;

11 years agomanpages: Changes references from git- to gbp-
Guido Günther [Wed, 26 Jun 2013 10:54:48 +0000 (12:54 +0200)]
manpages: Changes references from git- to gbp-

11 years agodocs: Use gbp <command> instead of {git,gbp}-<command>
Guido Günther [Wed, 26 Jun 2013 10:27:05 +0000 (12:27 +0200)]
docs: Use gbp <command> instead of {git,gbp}-<command>

11 years agoAdd gbp manpage
Guido Günther [Wed, 26 Jun 2013 09:56:38 +0000 (11:56 +0200)]
Add gbp manpage

11 years agoBash complete on "gbp <command>" too
Guido Günther [Wed, 26 Jun 2013 09:42:27 +0000 (11:42 +0200)]
Bash complete on "gbp <command>" too

11 years agoGit-Ignore generated gbp.conf.5 too
Guido Günther [Wed, 26 Jun 2013 10:09:31 +0000 (12:09 +0200)]
Git-Ignore generated gbp.conf.5 too

11 years agoGbpOptionParser: add test for 'filter' option handling
Guido Günther [Wed, 19 Jun 2013 09:38:21 +0000 (11:38 +0200)]
GbpOptionParser: add test for 'filter' option handling

11 years agoGbpOptionParser: Make sure we parse the old config sections
Guido Günther [Tue, 18 Jun 2013 22:25:53 +0000 (00:25 +0200)]
GbpOptionParser: Make sure we parse the old config sections

For backward compatibility between {gbp,git}-<subcommand> and "gbp
<subcommand>" make sure we parse the former sections if using the later.

11 years agoGbpOptionParser: Make sure we access the GbpOptionParser*'s default dict
Guido Günther [Wed, 19 Jun 2013 09:31:45 +0000 (11:31 +0200)]
GbpOptionParser: Make sure we access the GbpOptionParser*'s default dict

and not the one from the OptionParser. The instance's default dict this
gets reset to empty when invoking OptionParser.__init__.

11 years agoAdd wrapper for all gbp commands
Guido Günther [Sun, 8 Jan 2012 18:35:34 +0000 (19:35 +0100)]
Add wrapper for all gbp commands

So like git you can now use gbp <command> instead of git-<command> or
gbp-<command>. The manpages and docs aren't adjusted yet.

11 years agoGitRepository/diff: allow single object
Markus Lehtonen [Thu, 29 Nov 2012 17:17:59 +0000 (19:17 +0200)]
GitRepository/diff: allow single object

Allow diffing a single object, e.g. getting diff from single commit.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoSimplify expression
Guido Günther [Tue, 11 Jun 2013 13:37:22 +0000 (15:37 +0200)]
Simplify expression

Git-Dch: Ignore

11 years agoGitRepository.get_subject: use get_commit_info
Guido Günther [Tue, 11 Jun 2013 13:20:44 +0000 (15:20 +0200)]
GitRepository.get_subject: use get_commit_info

This kills another _git_getoutput. Also deprecate the method since we
don't need to special case the subject.

11 years agobuildpackage: use get_commit_info() instead of get_subject()
Markus Lehtonen [Mon, 6 May 2013 12:19:58 +0000 (15:19 +0300)]
buildpackage: use get_commit_info() instead of get_subject()

Utilize the get_commit_info() method of GitRepository instead of the
deprecated get_subject().

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoRemove unused imports
Guido Günther [Tue, 11 Jun 2013 13:15:58 +0000 (15:15 +0200)]
Remove unused imports

11 years agoimport-orig: keep working copy in sync with branch HEAD
Markus Lehtonen [Wed, 28 Nov 2012 08:43:20 +0000 (10:43 +0200)]
import-orig: keep working copy in sync with branch HEAD

Update working copy and index (to branch HEAD) if we modify the
currently checked-out branch. Otherwise the repository is left in
unclean state when the current branch is upstream or pristine-tar and
the '--no-merge' option is used.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoGitRepository/get_commit_info: add patchname to info
Markus Lehtonen [Tue, 7 Aug 2012 13:22:00 +0000 (16:22 +0300)]
GitRepository/get_commit_info: add patchname to info

Add a new 'patchname' field to the information returned by
get_commit_info. That is, the subject in a sanitized format, similar to
what git-format-patch uses.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agogitmodifier: make the datetime object always have timezone
Markus Lehtonen [Thu, 29 Nov 2012 17:11:21 +0000 (19:11 +0200)]
gitmodifier: make the datetime object always have timezone

To be consistent with the date property and for easier compatibility
with git dates.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoDocument changes and release 0.6.0~git20130630 debian/0.6.0_git20130530
Guido Günther [Thu, 30 May 2013 13:24:32 +0000 (15:24 +0200)]
Document changes and release 0.6.0~git20130630

11 years agoAdd Jenkins Scratchbuilder example
Guido Günther [Sun, 5 May 2013 10:59:56 +0000 (12:59 +0200)]
Add Jenkins Scratchbuilder example

It's a simple script that can be used to build Debian packages via gbp
and Jenkins.

11 years agogit-buildpackage: Unbreak overlay mode
Gaudenz Steinlin [Fri, 17 May 2013 12:44:47 +0000 (14:44 +0200)]
git-buildpackage: Unbreak overlay mode

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Closes: #708636

11 years agoGitRepository: Use LC_ALL=C when checking features
Guido Günther [Wed, 8 May 2013 14:40:41 +0000 (16:40 +0200)]
GitRepository: Use LC_ALL=C when checking features

This fixes the doctest and also makes sure we use an up to date manpage.

Thanks: Daniel Dehennin for the report

11 years agoDocument changes and release 0.6.0~git20130506 debian/0.6.0_git20130506
Guido Günther [Mon, 6 May 2013 17:26:22 +0000 (19:26 +0200)]
Document changes and release 0.6.0~git20130506

11 years agomanpages: Document gbp-pull's --ignore-branch option
Guido Günther [Sat, 4 May 2013 12:13:07 +0000 (14:13 +0200)]
manpages: Document gbp-pull's --ignore-branch option

11 years agogbp-pull: Fix typo in help output
Guido Günther [Sat, 4 May 2013 12:00:05 +0000 (14:00 +0200)]
gbp-pull: Fix typo in help output

11 years agoGitRepository Use _git_inout in get_branch
Guido Günther [Thu, 2 May 2013 20:20:02 +0000 (22:20 +0200)]
GitRepository Use _git_inout in get_branch

to suppress the confusiong "fatal: ref HEAD is not a symbolic ref". We
alrady put out a more descriptive error message. This makes using
--ignore-branch look far less dangerous.

11 years agoAdd --ignore-branch to gbp-pull
Guido Günther [Thu, 2 May 2013 19:46:47 +0000 (21:46 +0200)]
Add --ignore-branch to gbp-pull

This allows us to fetch upstream and pristine-tar even when in detached
head state. This can be usefull when e.g. building in jenkins which uses
a detached head by default.

11 years agodch: make sure branch is always defined
Guido Günther [Thu, 2 May 2013 19:35:10 +0000 (21:35 +0200)]
dch: make sure branch is always defined

This fixes a problem when running git-dch form a detached HEAD

11 years agotrivial: simplify option assignment
Guido Günther [Tue, 30 Apr 2013 14:57:38 +0000 (16:57 +0200)]
trivial: simplify option assignment

to ease readability

11 years agoSilence test_debian_missing_author
Guido Günther [Tue, 30 Apr 2013 14:49:34 +0000 (16:49 +0200)]
Silence test_debian_missing_author

and better use the output for verification

11 years agoSilence dpkg --compare-versions
Guido Günther [Mon, 29 Apr 2013 20:33:37 +0000 (22:33 +0200)]
Silence dpkg --compare-versions

and add the error detail to the exception message. This silences the
testsuite and makes sure we have error message and exception output in
sync.

11 years agoUse Popen.communicate instead of subprocess call
Guido Günther [Mon, 29 Apr 2013 17:59:12 +0000 (19:59 +0200)]
Use Popen.communicate instead of subprocess call

so we can capture stderr and use it in error messages intead of spewing
it on the console.

11 years agoMake parse_dsc a classmethod of DscFile
Guido Günther [Mon, 29 Apr 2013 18:55:40 +0000 (20:55 +0200)]
Make parse_dsc a classmethod of DscFile

so we have the object creation close to the object itself.

11 years agoChangeLog: Remove is_native
Guido Günther [Mon, 29 Apr 2013 12:45:44 +0000 (14:45 +0200)]
ChangeLog: Remove is_native

to avoid accidental usage. Use DebianSource.is_native instead.

11 years agodch: Use DebianSource.is_native
Guido Günther [Mon, 29 Apr 2013 12:31:43 +0000 (14:31 +0200)]
dch: Use DebianSource.is_native

instead of ChangeLog.is_native since the former used
debian/source/format in favor of debian/changelog.

11 years agoRevert "Use Popen.communicate instead of subprocess call"
Guido Günther [Mon, 29 Apr 2013 12:31:37 +0000 (14:31 +0200)]
Revert "Use Popen.communicate instead of subprocess call"

This reverts commit 0c582cd827f164168a313e0bb4eabf9487bdd088.

11 years agoUse Popen.communicate instead of subprocess call
Guido Günther [Mon, 29 Apr 2013 12:30:31 +0000 (14:30 +0200)]
Use Popen.communicate instead of subprocess call

so we can caputure stderr and pass it along with any errors.

11 years agoGitRepository.has_feature: capture stderr
Guido Günther [Sat, 27 Apr 2013 20:26:36 +0000 (22:26 +0200)]
GitRepository.has_feature: capture stderr

to avoid spurious output on the console and add the error message to the
exception intead.

11 years agoGitRepository.commit_dir: raise GitRepositoryError instead of GbpError
Guido Günther [Sat, 27 Apr 2013 20:20:04 +0000 (22:20 +0200)]
GitRepository.commit_dir: raise GitRepositoryError instead of GbpError

and make sure the callers forward the error properly

11 years agoSilence GitRepository.write_tree
Guido Günther [Sat, 27 Apr 2013 20:15:43 +0000 (22:15 +0200)]
Silence GitRepository.write_tree

but add any error output to the exception instead. All callers have been
audited to properly output the message if needed.

11 years agocommand_wrappers: allow to silence __call__
Guido Günther [Sat, 27 Apr 2013 20:02:18 +0000 (22:02 +0200)]
command_wrappers: allow to silence __call__

and use that in the doctest to get rid of the spurious output

11 years agoDiscard git mailinfo's error message
Guido Günther [Fri, 26 Apr 2013 22:35:19 +0000 (00:35 +0200)]
Discard git mailinfo's error message

since we don't expect it to succeed.

11 years agoSilence GitRepository.grep_log
Guido Günther [Fri, 26 Apr 2013 22:12:26 +0000 (00:12 +0200)]
Silence GitRepository.grep_log

None of the gbp script rely on the output being printed. In fact we
improve the exception by appending the stderr output.

11 years agoSilence GitRepository.set_upstream_branch
Guido Günther [Fri, 26 Apr 2013 22:00:06 +0000 (00:00 +0200)]
Silence GitRepository.set_upstream_branch

It's not used within gbp itself so no command line tool expects
an error message to be printed.

11 years agoSilence GitRepository.has_treeish
Guido Günther [Fri, 26 Apr 2013 21:52:55 +0000 (23:52 +0200)]
Silence GitRepository.has_treeish

This also silences 10_test_get_upstream_tree

11 years ago10_test_get_upstream_tree: Fix test descriptions
Guido Günther [Fri, 26 Apr 2013 21:28:16 +0000 (23:28 +0200)]
10_test_get_upstream_tree: Fix test descriptions

11 years ago14_test_gbp_import_dscs: Mock gbp.log.err
Guido Günther [Fri, 26 Apr 2013 21:13:29 +0000 (23:13 +0200)]
14_test_gbp_import_dscs: Mock gbp.log.err

to get rid of the spurious error message

11 years agobuildpackage: implement --[no-]hooks option
Markus Lehtonen [Mon, 22 Apr 2013 07:38:54 +0000 (10:38 +0300)]
buildpackage: implement --[no-]hooks option

For enabling/disabling all hooks. This option does not affect the
builder command, though.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agotests: Fix tests for Ubuntu
Markus Lehtonen [Wed, 3 Apr 2013 12:29:19 +0000 (15:29 +0300)]
tests: Fix tests for Ubuntu

On Ubuntu dch produces different version numbering. Adapt tests for
this.

Adds a jew class to parse '/etc/lsb-release' to determine the
distribution and it's codename to dynamically adapt tests accordingly.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoDebianSource: fix is_native()
Markus Lehtonen [Fri, 26 Apr 2013 09:58:38 +0000 (12:58 +0300)]
DebianSource: fix is_native()

Determine from changelog if debian/source/format does not provide any
type (1.0 format).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agotests: add missing import in test_Changelog
Markus Lehtonen [Mon, 22 Apr 2013 19:03:46 +0000 (22:03 +0300)]
tests: add missing import in test_Changelog

That was erroneously removed in
3d6b68ae541d6020ff747628b3e44196999e0a50.

and breaks without dch installed

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoGitRepository: add describe() method
Markus Lehtonen [Mon, 3 Dec 2012 09:03:06 +0000 (11:03 +0200)]
GitRepository: add describe() method

Provides more output options than find_tag().
- longfmt: for getting the tag name in the long format (tag, number of
  commits and sha1)
- always: for falling back to sha1 if no (matching) tag name is found
- abbrev: for defining the length of sha1 returned

Change GitRepository.find_tag() to use the the new method.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agotests: another fix for older dch
Markus Lehtonen [Thu, 25 Apr 2013 09:23:47 +0000 (12:23 +0300)]
tests: another fix for older dch

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agotests: fix for older dch
Markus Lehtonen [Tue, 23 Apr 2013 07:59:41 +0000 (10:59 +0300)]
tests: fix for older dch

Prevent dch from asking user input during tests.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agobuildpackage: catch and handle DebianSourceError gracefully
Markus Lehtonen [Mon, 22 Apr 2013 15:43:09 +0000 (18:43 +0300)]
buildpackage: catch and handle DebianSourceError gracefully

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoDebianSource: raise DebianSourceError if reading changelog fails
Markus Lehtonen [Mon, 22 Apr 2013 15:42:00 +0000 (18:42 +0300)]
DebianSource: raise DebianSourceError if reading changelog fails

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agobash completion: handle upstream-tree like upstream-branch
Guido Günther [Wed, 24 Apr 2013 05:24:05 +0000 (07:24 +0200)]
bash completion: handle upstream-tree like upstream-branch

That's as close as it gets since every ref like is valid

11 years agoSilence _git_command
Guido Günther [Wed, 24 Apr 2013 05:10:56 +0000 (07:10 +0200)]
Silence _git_command

by using _git_inout instead of GitCommand

11 years agoSilence git clone
Guido Günther [Wed, 24 Apr 2013 05:10:11 +0000 (07:10 +0200)]
Silence git clone

by using __git_inout instead of GitCommand

11 years agoGitRepository: make __build_env a static method
Guido Günther [Sun, 14 Apr 2013 11:35:53 +0000 (13:35 +0200)]
GitRepository: make __build_env a static method

since cls is unused and it silences pychecker

11 years agoSilence git init
Guido Günther [Sun, 14 Apr 2013 11:02:38 +0000 (13:02 +0200)]
Silence git init

to make the test suite less verbose

11 years agoDocument changes and release 0.6.0~git20130414 debian/0.6.0_git20130414
Guido Günther [Sat, 13 Apr 2013 17:37:25 +0000 (19:37 +0200)]
Document changes and release 0.6.0~git20130414

11 years agoDon't try access source before it's filled
Guido Günther [Sat, 13 Apr 2013 17:36:04 +0000 (19:36 +0200)]
Don't try access source before it's filled

11 years agoDocument changes and release 0.6.0~git20130413
Guido Günther [Sat, 13 Apr 2013 12:28:39 +0000 (14:28 +0200)]
Document changes and release 0.6.0~git20130413

11 years agoAdd gbp.git.source.Source.sourcepkg
Guido Günther [Sat, 13 Apr 2013 11:50:01 +0000 (13:50 +0200)]
Add gbp.git.source.Source.sourcepkg

to easily fetch the source package name

Git-Dch: Ignore

11 years agoHonor debian/source/format
Guido Günther [Sat, 13 Apr 2013 01:02:02 +0000 (03:02 +0200)]
Honor debian/source/format

when checking if a package is a native package

Closes: #669267

11 years agoIntroduce Source class
Guido Günther [Fri, 29 Mar 2013 14:55:12 +0000 (15:55 +0100)]
Introduce Source class

so we don't have to expose all the details of Debian's different
files and conventions.

11 years agoAdd minimal vfs interface
Guido Günther [Mon, 8 Apr 2013 08:20:23 +0000 (10:20 +0200)]
Add minimal vfs interface

so we can access blobs in git as file like objects

11 years agoUse _git_inout for git.show
Guido Günther [Sat, 13 Apr 2013 10:56:10 +0000 (12:56 +0200)]
Use _git_inout for git.show

so we don't spew the error message on stdout for nonexistent objects

11 years agoRevert "GitRepository.show: use _git_inout()"
Guido Günther [Mon, 8 Apr 2013 09:05:32 +0000 (11:05 +0200)]
Revert "GitRepository.show: use _git_inout()"

This changes the newline behaviour. readlines() as used by
_git_getoutput correctly keeps the newlines while this change doesn't.

This reverts commit 92edb4eda14cf4b5fd1514feb7b81aa50456285c.

11 years agotests: Use tempfile.mkdtemp to create temp dirs for tests
Thomas Koch [Mon, 21 Jan 2013 14:50:39 +0000 (15:50 +0100)]
tests: Use tempfile.mkdtemp to create temp dirs for tests

This puts test dirs below /tmp which often is a tmpfs.

All tests include the context module which consolidates tmpdir creation
and cleanup, undoes a chdir in teardown and silences log messages.

11 years agoGitRepository.show: use _git_inout()
Markus Lehtonen [Mon, 25 Mar 2013 09:09:36 +0000 (11:09 +0200)]
GitRepository.show: use _git_inout()

Instead of the deprecated _git_getoutput() method. Also, capture stderr
and put the error message to the exception, instead.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoAdd .coveragerc
Markus Lehtonen [Tue, 19 Mar 2013 13:05:02 +0000 (15:05 +0200)]
Add .coveragerc

To get correct report if coverage is invoked directly (not through
nose/disttools) in order to get an xml report, for example.

Currently only used for restricting the coverage output to the gbp
python package. That is, same thing that 'cover-package' option in
setup.cfg does.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoFix typos
Guido Günther [Sat, 6 Apr 2013 20:15:21 +0000 (22:15 +0200)]
Fix typos

Git-Dch: Ignore

11 years agoGenerate coverage xml
Guido Günther [Fri, 29 Mar 2013 12:15:18 +0000 (13:15 +0100)]
Generate coverage xml

for cobertura style coverage information that can be picked up
by e.g. Jenkins

11 years agoAdd urgency management.
Daniel Dehennin [Mon, 21 Nov 2011 18:57:18 +0000 (19:57 +0100)]
Add urgency management.

* tests/11_test_dch_main.py: test the new --urgency option to
  dch.main(). Add only meaningful tests, i.e. options alone and combined
  with --release and --snapshot.

* git-dch (fixup_section): Manage "urgency" option.
  (main): Add version_group option "-U" and "--urgency" to set the
  urgency level of the entry.

* docs/manpages/git-dch.sgml: Update documentation for new option.

11 years agoAdd option to manage distribution fields for non snapshot mode.
Daniel Dehennin [Mon, 21 Nov 2011 14:44:41 +0000 (15:44 +0100)]
Add option to manage distribution fields for non snapshot mode.

The snapshot mode fails to merge two "debian/changelog" entries if the
distribution is not "UNRELEASED".

* tests/11_test_dch_main.py: test the new --distribution option to
  dch.main(). Add only meaningful tests, i.e. options alone and combined
  with --release and --snapshot.

* git-dch (fixup_section): Rename as it's used to fix header in addition
  to trailer, this require a new named parameter "options".
  (main): Add version_group option "-D" and "--distribution" to
  specify the distribution name.
  Add version_group option "--force-distribution" to force the provided
  distribution to be used, used by "dch".
  Rename fixup_trailer() to fixup_section() and add options as parameters.

* docs/manpages/git-dch.sgml: Update documentation for new options.

Closes: #646684

11 years agoMove DscFile to separate module
Guido Günther [Fri, 29 Mar 2013 14:35:55 +0000 (15:35 +0100)]
Move DscFile to separate module

11 years agoMove DebianPkgPolicy to separate module
Guido Günther [Fri, 29 Mar 2013 14:24:02 +0000 (15:24 +0100)]
Move DebianPkgPolicy to separate module

11 years agoMove debian/changelog manipulation to gbp.deb.changelog.ChangeLog.
Daniel Dehennin [Wed, 30 May 2012 19:30:45 +0000 (21:30 +0200)]
Move debian/changelog manipulation to gbp.deb.changelog.ChangeLog.

spawn_dch switch gbp.command.wrappers.Command.

* gbp/deb/changelog.py (ChangeLog.spawn_dch): static method adapted from
  gbp.scripts.dch and converted to gbp.command_wrappers.Command.
  (add_entry): New method adapted from
  gbp.scripts.dch.add_changelog_entry.
  (add_section): New method adapted from
  gbp.scripts.dch.add_changelog_entry. Remove DebianGitRepository and
  options, this has nothing to do with changelog management.

* tests/test_Changelog.py: Test new methods.

* gbp/scripts/dch.py: Remove useless functions: system(), spawn_dch(),
  add_changelog_section() and add_changelog_entry().
  Update calls accordingly.
  (fixup_trailer): Use spawn_dch() method of ChangeLog class.
  (process_options): dch_options became a list.
  (main): Use add_section() and add_entry() methods of ChangeLog object.
  Take care of upstream version since ChangeLog.add_section() does not
  manage it anymore.
  Update exception handling, ChangeLog.spawn_dch() can raise
  "CommandExecFailed" exception.

Closes: #672954

11 years agoDocument changes and release 0.6.0~git20130329 debian/0.6.0_git20130329
Guido Günther [Fri, 29 Mar 2013 11:35:52 +0000 (12:35 +0100)]
Document changes and release 0.6.0~git20130329

11 years agoInclude the name of the package being built in the debian tag message
Daniel Kahn Gillmor [Tue, 26 Mar 2013 21:41:53 +0000 (17:41 -0400)]
Include the name of the package being built in the debian tag message

Currently, the message in the debian tag is just:

  "Debian release %s" % cp.version

This is a bad idea, because it means that the signed message itself
contains no mention of the project that is being worked on.

Since all git repositories are conceptually the same git repository
(some just have commits that others don't have), a malicious attacker
could inject tags from project A into the repository for project B and
the original developer's signature on those tags would be intact.

This is potentially a security problem.  For example: if there are
automated build systems that pull from a repo and verify signed tags
made by a known developer (and that developer contributes to multiple
projects), this conflation could be used to make those systems build
packages from an entirely other project.

The attached patch enforces the inclusion of the name of the package
into the tag's message.

Closes: #704018