comparison hglib/client.py @ 48:82d927ac1329

client: add addremove command
author Idan Kamara <idankk86@gmail.com>
date Thu, 18 Aug 2011 16:20:04 +0300
parents 94d2988e55b7
children bd7dfd94b0d9
comparison
equal deleted inserted replaced
47:94d2988e55b7 48:82d927ac1329
165 raise error.CommandError(args, ret, out, err) 165 raise error.CommandError(args, ret, out, err)
166 166
167 self.rawcommand(args, eh=eh) 167 self.rawcommand(args, eh=eh)
168 return not warnings[0] 168 return not warnings[0]
169 169
170 def addremove(self, files=[], similarity=None, dryrun=False, include=None,
171 exclude=None):
172 if not isinstance(files, list):
173 files = [files]
174
175 args = cmdbuilder('addremove', *files, s=similarity, n=dryrun, I=include,
176 X=exclude)
177
178 # we could use Python 3 nonlocal here...
179 warnings = [False]
180
181 def eh(ret, out, err):
182 if ret == 1:
183 warnings[0] = True
184 else:
185 raise error.CommandError(args, ret, out, err)
186
187 self.rawcommand(args, eh=eh)
188 return not warnings[0]
189
170 def backout(self, rev, merge=False, parent=None, tool=None, message=None, 190 def backout(self, rev, merge=False, parent=None, tool=None, message=None,
171 logfile=None, date=None, user=None): 191 logfile=None, date=None, user=None):
172 if message and logfile: 192 if message and logfile:
173 raise ValueError("cannot specify both a message and a logfile") 193 raise ValueError("cannot specify both a message and a logfile")
174 194