From 88afa6117ea4dd6b5d8fd88936afffb11c25ec47 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 6 Aug 2010 13:55:53 -0400 Subject: Pass --multimaint-merge on to dch Closes: #586165 --- debian/control | 2 +- docs/manpages/git-dch.sgml | 8 ++++++++ gbp/config.py | 5 ++++- git-dch | 28 +++++++++++++++++++++++----- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/debian/control b/debian/control index e60f3b22..c9a63cab 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Homepage: https://honk.sigxcpu.org/piki/projects/git-buildpackage/ Package: git-buildpackage Architecture: all -Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, devscripts (>= 2.10.49), +Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, devscripts (>= 2.10.66~), git (>= 1:1.7.0.4-2) | git-core (>= 1:1.5.0.1-1), python-dateutil Recommends: pristine-tar (>= 0.5) Suggests: git-load-dirs diff --git a/docs/manpages/git-dch.sgml b/docs/manpages/git-dch.sgml index e8683eb0..5b64e196 100644 --- a/docs/manpages/git-dch.sgml +++ b/docs/manpages/git-dch.sgml @@ -35,6 +35,7 @@ expression git-log-options + [path1 path2] @@ -204,6 +205,13 @@ Use user.name and user.email from git-config(1) for changelog trailer. + + + + + Merge commits by maintainer. + + diff --git a/gbp/config.py b/gbp/config.py index d8b22213..10e1a5b9 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -59,7 +59,8 @@ class GbpOptionParser(OptionParser): 'ignore-regex' : '', 'compression' : 'auto', 'compression-level': '9', - 'remote-url-pattern' : 'ssh://alioth.debian.org/git/collab-maint/%(pkg)s.git' + 'remote-url-pattern' : 'ssh://alioth.debian.org/git/collab-maint/%(pkg)s.git', + 'multimaint-merge' : 'False', } help = { 'debian-branch': @@ -96,6 +97,8 @@ class GbpOptionParser(OptionParser): "extract orig tarball when using export-dir option, default is '%(overlay)s'", 'remote-url-pattern': "Remote url pattern to create the repo at, default is '%(remote-url-pattern)s'", + 'multimaint-merge': + "Merge commits by maintainer, default is '%(multimaint-merge)s'", } config_files = [ '/etc/git-buildpackage/gbp.conf', os.path.expanduser('~/.gbp.conf'), diff --git a/git-dch b/git-dch index b1ce409f..79341c09 100755 --- a/git-dch +++ b/git-dch @@ -65,7 +65,18 @@ def punctuate_commit(msg): return msg return "%s.\n%s" % (first, rest) -def spawn_dch(msg='', author=None, email=None, newversion=False, version=None, release=False, distribution=None): +def spawn_dch(msg='', author=None, email=None, newversion=False, version=None, + release=False, distribution=None, dch_options=""): + """ + Spawn dch + param author: committers name + param email: committers email + param newversion: start a new version + version: the verion to use + release: finalize changelog for releaze + distribution: distribution to use + dch_options: options passed verbatim to dch + """ distopt = "" versionopt = "" env = "" @@ -88,15 +99,15 @@ def spawn_dch(msg='', author=None, email=None, newversion=False, version=None, r if distribution: distopt = "--distribution=%s" % distribution - cmd = '%(env)s dch --no-auto-nmu %(distopt)s %(versionopt)s ' % locals() + cmd = '%(env)s dch --no-auto-nmu %(distopt)s %(versionopt)s %(dch_options)s ' % locals() if type(msg) == type(''): cmd += '-- "%s"' % escape_commit(msg) system(cmd) -def add_changelog_entry(msg, author, email): +def add_changelog_entry(msg, author, email, dch_options): "add a single changelog entry" - spawn_dch(msg=msg, author=author, email=email) + spawn_dch(msg=msg, author=author, email=email, dch_options=dch_options) def add_changelog_section(msg, distribution, author=None, email=None, version=None): @@ -350,6 +361,8 @@ def main(argv): type="int", metavar="N") commit_group.add_config_file_option(option_name="ignore-regex", dest="ignore_regex", help="Ignore commit lines matching regex, default is '%(ignore-regex)s'") + commit_group.add_boolean_config_file_option(option_name="multimaint-merge", dest="multimaint_merge") + (options, args) = parser.parse_args(argv[1:]) if options.snapshot and options.release: @@ -358,6 +371,11 @@ def main(argv): if options.since and options.auto: parser.error("'--since' and '--auto' are incompatible options") + if options.multimaint_merge: + dch_options = "--multimaint-merge" + else: + dch_options = "--nomultimaint-merge" + try: if options.verbose: gbpc.Command.verbose = True @@ -421,7 +439,7 @@ def main(argv): # Adding a section only needs to happen once. add_section = False else: - add_changelog_entry(commit_msg, commit_author, commit_email) + add_changelog_entry(commit_msg, commit_author, commit_email, dch_options) # Show a message if there were no commits (not even ignored -- cgit v1.2.3