aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/deb
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-11-27 19:59:32 +0100
committerGuido Günther <agx@sigxcpu.org>2017-11-27 22:49:52 +0100
commit90a1a99169521df9de2b1bfc3c129402ee1158fc (patch)
tree8ec60013f4fdaaee54b7809c1ef7d4a6bf70d49e /gbp/deb
parent7c05c02f2d0380ea2304a81f3c9f133161204c44 (diff)
ChangeLog: add class method to create empty changelogs
Diffstat (limited to 'gbp/deb')
-rw-r--r--gbp/deb/changelog.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/gbp/deb/changelog.py b/gbp/deb/changelog.py
index 1d7bc47e..e7e03257 100644
--- a/gbp/deb/changelog.py
+++ b/gbp/deb/changelog.py
@@ -272,6 +272,10 @@ class ChangeLog(object):
args.append("--distribution=%s" % distribution)
args.extend(dch_options or [])
+
+ if '--create' in args:
+ env['EDITOR'] = env['VISUAL'] = '/bin/true'
+
args.append('--')
if msg:
args.append('[[[insert-git-dch-commit-message-here]]]')
@@ -344,3 +348,17 @@ class ChangeLog(object):
name, mail = email.utils.parseaddr(_quote(maintainer or ''))
return (_unquote(name), _unquote(mail))
+
+ @classmethod
+ def create(cls, package=None, version=None):
+ """
+ Create a new, empty changelog
+ """
+ dch_options = ['--create']
+ if package:
+ dch_options.extend(['--package', package])
+ if version:
+ dch_options.extend(['--newversion', version])
+
+ cls.spawn_dch(dch_options=dch_options)
+ return cls(filename='debian/changelog')