Move debian/changelog manipulation to gbp.deb.changelog.ChangeLog.
authorDaniel Dehennin <daniel.dehennin@baby-gnu.org>
Wed, 30 May 2012 19:30:45 +0000 (21:30 +0200)
committerGuido Günther <agx@sigxcpu.org>
Fri, 29 Mar 2013 12:08:23 +0000 (13:08 +0100)
commita9bf9cfd4b31076c54d4e377c1b31b5bd69f8661
tree0df3fdd5a8a7bf006432c4eac1a5048e6f62bbd3
parentea544accfd549d76618a10d831ce7e830fd0785a
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
gbp/deb/changelog.py
gbp/scripts/dch.py
tests/test_Changelog.py