diff hglib/client.py @ 16:943aff89b068

client: add missing options to commit()
author Idan Kamara <idankk86@gmail.com>
date Wed, 10 Aug 2011 20:33:08 +0300
parents f1af31960414
children b68c444d42bb
line wrap: on
line diff
--- a/hglib/client.py	Wed Aug 10 19:59:08 2011 +0300
+++ b/hglib/client.py	Wed Aug 10 20:33:08 2011 +0300
@@ -180,9 +180,17 @@
         args = cmdbuilder('clone', source, dest, b=branch, u=updaterev, r=revrange)
         self.rawcommand(args)
 
-    def commit(self, message, addremove=False):
+    def commit(self, message=None, logfile=None, addremove=False, closebranch=False,
+               date=None, user=None, include=None, exclude=None):
+        if message is None and logfile is None:
+            raise ValueError("must provide at least a message or a logfile")
+        elif message and logfile:
+            raise ValueError("cannot specify both a message and a logfile")
+
         # --debug will print the committed cset
-        args = cmdbuilder('commit', debug=True, m=message, A=addremove)
+        args = cmdbuilder('commit', debug=True, m=message, A=addremove,
+                          close_branch=closebranch, d=date, u=user, l=logfile,
+                          I=include, X=exclude)
 
         out = self.rawcommand(args)
         rev, node = out.splitlines()[-1].rsplit(':')