GitRepository.commit_files: add committer_info argument
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 5 Feb 2014 14:11:42 +0000 (16:11 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:22:04 +0000 (14:22 +0200)
For setting the committer name/email/date - similarly to author_info.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/git/repository.py

index 217f799..3dfcb45 100644 (file)
@@ -1363,8 +1363,11 @@ class GitRepository(object):
 
 #{ Comitting
 
-    def _commit(self, msg, args=[], author_info=None, edit=False):
+    def _commit(self, msg, args=[], author_info=None,
+                committer_info=None, edit=False):
         extra_env = author_info.get_author_env() if author_info else None
+        if committer_info:
+            extra_env.update(committer_info.get_committer_env())
         default_args = ['-q', '-m', msg] + (['--edit'] if edit else [])
         self._git_command("commit", default_args + args, extra_env=extra_env,
                           interactive=edit)
@@ -1392,7 +1395,7 @@ class GitRepository(object):
         """
         self._commit(msg=msg, args=['-a'], author_info=author_info, edit=edit)
 
-    def commit_files(self, files, msg, author_info=None):
+    def commit_files(self, files, msg, author_info=None, committer_info=None):
         """
         Commit the given files to the repository
 
@@ -1402,10 +1405,13 @@ class GitRepository(object):
         @type msg: C{str}
         @param author_info: authorship information
         @type author_info: L{GitModifier}
+        @param committer_info: committer information
+        @type committer_info: L{GitModifier}
         """
         if isinstance(files, basestring):
             files = [ files ]
-        self._commit(msg=msg, args=files, author_info=author_info)
+        self._commit(msg=msg, args=files, author_info=author_info,
+                     committer_info=committer_info)
 
     def create_tree(self, unpack_dir):
         """