Fixes side-effect of
e58f264a "Add support for merge-friendly
branches".
Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
return getattr(self, n)
return property(new_f)
return getattr(self, n)
return property(new_f)
-def update_commit_data(cd, options, allow_edit = False):
+def update_commit_data(cd, options):
"""Return a new CommitData object updated according to the command line
options."""
# Set the commit message from commandline.
"""Return a new CommitData object updated according to the command line
options."""
# Set the commit message from commandline.
add_sign_line(cd.message, sign_str,
cd.committer.name, cd.committer.email))
add_sign_line(cd.message, sign_str,
cd.committer.name, cd.committer.email))
- # Let user edit the commit message manually.
- if allow_edit and not options.message:
+ # Let user edit the commit message manually, unless
+ # --save-template or --message was specified.
+ if not getattr(options, 'save_template', None) and not options.message:
cd = cd.set_message(edit_string(cd.message, '.stgit-new.txt'))
return cd
cd = cd.set_message(edit_string(cd.message, '.stgit-new.txt'))
return cd
cd = gitlib.CommitData(
tree = stack.head.data.tree, parents = [stack.head], message = '',
author = gitlib.Person.author(), committer = gitlib.Person.committer())
cd = gitlib.CommitData(
tree = stack.head.data.tree, parents = [stack.head], message = '',
author = gitlib.Person.author(), committer = gitlib.Person.committer())
- cd = common.update_commit_data(cd, options, allow_edit = True)
+ cd = common.update_commit_data(cd, options)
if options.save_template:
options.save_template(cd.message)
if options.save_template:
options.save_template(cd.message)
cd = git.CommitData(
tree = tree, parents = parents, message = message,
author = git.Person.author(), committer = git.Person.committer())
cd = git.CommitData(
tree = tree, parents = parents, message = message,
author = git.Person.author(), committer = git.Person.committer())
- cd = common.update_commit_data(cd, options, allow_edit = True)
+ cd = common.update_commit_data(cd, options)
return repository.commit(cd)
return repository.commit(cd)