diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-12-08 10:32:35 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-12-09 19:13:29 +0100 |
commit | d207065cd8679318a0875fff2f8cb6aa63e2f0bf (patch) | |
tree | 3186ff73549a8006334fd98b217e05649f5fe04a /git-dch | |
parent | d12a32f732575c52552e9e5c99905d2c15621dd9 (diff) |
Introduce functions
to self document the code a bit
Diffstat (limited to 'git-dch')
-rwxr-xr-x | git-dch | 49 |
1 files changed, 29 insertions, 20 deletions
@@ -264,6 +264,34 @@ def guess_snapshot_commit(cp, repo, options): return None +def get_customizations(customization_file): + if customization_file: + execfile(customization_file, + user_customizations, + user_customizations) + + +def process_options(options): + if options.snapshot and options.release: + parser.error("'--snapshot' and '--release' are incompatible options") + + 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" + + if options.multimaint: + dch_options += " --multimaint" + else: + dch_options += " --nomultimaint" + + get_customizations(options.customization_file) + return dch_options + + def main(argv): ret = 0 changelog = 'debian/changelog' @@ -337,27 +365,8 @@ def main(argv): (options, args) = parser.parse_args(argv[1:]) gbp.log.setup(options.color, options.verbose) + dch_options = process_options(options) - if options.snapshot and options.release: - parser.error("'--snapshot' and '--release' are incompatible options") - - 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" - - if options.multimaint: - dch_options += " --multimaint" - else: - dch_options += " --nomultimaint" - - if options.customization_file: - execfile(options.customization_file, - user_customizations, - user_customizations) try: try: repo = GitRepository('.') |