comparison mercurial/obsolete.py @ 22255:adb3798dce49

obsstore: add a `parents` argument to obsstore.create We need a way to pass the information to the function. Some guru told me that what's arguments are made for.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 18 Aug 2014 16:12:29 -0700
parents b8a0e8176693
children 3ae6cc6173e3
comparison
equal deleted inserted replaced
22254:b8a0e8176693 22255:adb3798dce49
270 return len(self._all) 270 return len(self._all)
271 271
272 def __nonzero__(self): 272 def __nonzero__(self):
273 return bool(self._all) 273 return bool(self._all)
274 274
275 def create(self, transaction, prec, succs=(), flag=0, date=None, 275 def create(self, transaction, prec, succs=(), flag=0, parents=None,
276 metadata=None): 276 date=None, metadata=None):
277 """obsolete: add a new obsolete marker 277 """obsolete: add a new obsolete marker
278 278
279 * ensuring it is hashable 279 * ensuring it is hashable
280 * check mandatory metadata 280 * check mandatory metadata
281 * encode metadata 281 * encode metadata
300 if len(succ) != 20: 300 if len(succ) != 20:
301 raise ValueError(succ) 301 raise ValueError(succ)
302 if prec in succs: 302 if prec in succs:
303 raise ValueError(_('in-marker cycle with %s') % node.hex(prec)) 303 raise ValueError(_('in-marker cycle with %s') % node.hex(prec))
304 marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata), 304 marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata),
305 date, None) 305 date, parents)
306 return bool(self.add(transaction, [marker])) 306 return bool(self.add(transaction, [marker]))
307 307
308 def add(self, transaction, markers): 308 def add(self, transaction, markers):
309 """Add new markers to the store 309 """Add new markers to the store
310 310