diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2010-02-05 12:57:48 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-02-05 17:41:24 +0100 |
commit | 2874c2331c7d24eac5f38febe3a38964ed7dac42 (patch) | |
tree | 10c6a03bd7af54d5873ff07199d702d4346a126c /git-import-orig | |
parent | 46544253084cb31ebcbec4bf969c99215cca10a7 (diff) | |
download | git-buildpackage-2874c2331c7d24eac5f38febe3a38964ed7dac42.tar.gz git-buildpackage-2874c2331c7d24eac5f38febe3a38964ed7dac42.tar.bz2 git-buildpackage-2874c2331c7d24eac5f38febe3a38964ed7dac42.zip |
Make the commit message for upstream imports configurable.
This adds the import-msg commandline and configuration file option to
change the commit message.
Closes: #474457
Diffstat (limited to 'git-import-orig')
-rwxr-xr-x | git-import-orig | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/git-import-orig b/git-import-orig index 8cc78658..6ee6228b 100755 --- a/git-import-orig +++ b/git-import-orig @@ -72,15 +72,14 @@ def symlink_orig(archive, pkg, version): return archive -def upstream_import_commit_msg(version): - return "Imported Upstream version %s" % version +def upstream_import_commit_msg(options, version): + return options.import_msg % dict(version=version) - -def import_upstream_tree(repo, src_dir, version, filters, verbose): +def import_upstream_tree(repo, src_dir, version, options, verbose): """import the upstream tree to the current branch""" try: - if repo.replace_tree(src_dir, filters, verbose=True): - gbpc.GitCommitAll(verbose=verbose)(msg=upstream_import_commit_msg(version)) + if repo.replace_tree(src_dir, options.filters, verbose=True): + gbpc.GitCommitAll(verbose=verbose)(msg=upstream_import_commit_msg(options, version)) else: raise GbpNothingImported except gbpc.CommandExecFailed: @@ -104,7 +103,7 @@ def fast_import_upstream_tree(repo, tarball, version, options): if options.verbose: print "Starting fastimport of %s" % tarball fastimport.start_commit(options.upstream_branch, name, email, now, - upstream_import_commit_msg(version)) + upstream_import_commit_msg(options, version)) fastimport.do_deleteall() for item in tar: @@ -192,6 +191,8 @@ def main(argv): dest="pristine_tar") import_group.add_boolean_config_file_option(option_name="filter-pristine-tar", dest="filter_pristine_tar") + import_group.add_config_file_option(option_name="import-msg", + dest="import_msg") cmd_group.add_config_file_option(option_name="postimport", dest="postimport", help="hook run after a successful import, default is '%(postimport)s'") @@ -295,7 +296,7 @@ on howto create it otherwise use --upstream-branch to specify it. if options.fast_import: fast_import_upstream_tree(repo, pristine_orig, version, options) else: - import_upstream_tree(repo, orig_dir, version, options.filters, verbose=not is_empty) + import_upstream_tree(repo, orig_dir, version, options, verbose=not is_empty) if options.pristine_tar: upstream_branch = [ options.upstream_branch, 'master' ][is_empty] |