aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-12-24 21:53:27 +0100
committerGuido Günther <agx@sigxcpu.org>2011-12-26 14:02:29 +0100
commite1f5a6da045f55e2290c4ad016209433d5ae66ac (patch)
tree2f3dad2fbeb6816f275986794e43bac9c06f195e /gbp/git/repository.py
parent4770a06ab765931286bc5ab6105c0d7dd6a86811 (diff)
gbp.git.repository: add edit option to commit_staged
to allow editing the commit message.
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index aae9a5e9..7ad19506 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -755,7 +755,7 @@ class GitRepository(object):
extra_env = author_info.get_author_env() if author_info else None
self._git_command("commit", ['-q', '-m', msg] + args, extra_env=extra_env)
- def commit_staged(self, msg, author_info=None):
+ def commit_staged(self, msg, author_info=None, edit=False):
"""
Commit currently staged files to the repository
@@ -763,10 +763,14 @@ class GitRepository(object):
@type msg: C{str}
@param author_info: authorship information
@type author_info: L{GitModifier}
+ @param edit: whether to spawn an editor to edit the commit info
+ @type edit: C{bool}
"""
- self._commit(msg=msg, author_info=author_info)
+ args = GitArgs()
+ args.add_true(edit, '--edit')
+ self._commit(msg=msg, args=args.args, author_info=author_info)
- def commit_all(self, msg, author_info=None):
+ def commit_all(self, msg, author_info=None, edit=False):
"""
Commit all changes to the repository
@param msg: commit message
@@ -774,7 +778,9 @@ class GitRepository(object):
@param author_info: authorship information
@type author_info: L{GitModifier}
"""
- self._commit(msg=msg, args=['-a'], author_info=author_info)
+ args = GitArgs('-a')
+ args.add_true(edit, '--edit')
+ self._commit(msg=msg, args=args.args, author_info=author_info)
def commit_files(self, files, msg, author_info=None):
"""