comparison 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
comparison
equal deleted inserted replaced
15:f1af31960414 16:943aff89b068
178 def clone(self, source='.', dest=None, branch=None, updaterev=None, 178 def clone(self, source='.', dest=None, branch=None, updaterev=None,
179 revrange=None): 179 revrange=None):
180 args = cmdbuilder('clone', source, dest, b=branch, u=updaterev, r=revrange) 180 args = cmdbuilder('clone', source, dest, b=branch, u=updaterev, r=revrange)
181 self.rawcommand(args) 181 self.rawcommand(args)
182 182
183 def commit(self, message, addremove=False): 183 def commit(self, message=None, logfile=None, addremove=False, closebranch=False,
184 date=None, user=None, include=None, exclude=None):
185 if message is None and logfile is None:
186 raise ValueError("must provide at least a message or a logfile")
187 elif message and logfile:
188 raise ValueError("cannot specify both a message and a logfile")
189
184 # --debug will print the committed cset 190 # --debug will print the committed cset
185 args = cmdbuilder('commit', debug=True, m=message, A=addremove) 191 args = cmdbuilder('commit', debug=True, m=message, A=addremove,
192 close_branch=closebranch, d=date, u=user, l=logfile,
193 I=include, X=exclude)
186 194
187 out = self.rawcommand(args) 195 out = self.rawcommand(args)
188 rev, node = out.splitlines()[-1].rsplit(':') 196 rev, node = out.splitlines()[-1].rsplit(':')
189 return int(rev.split()[-1]), node 197 return int(rev.split()[-1]), node
190 198