comparison hgext/bookmarks.py @ 11442:ee1ed6afac21 stable

addchangegroup: pass in lock to release it before changegroup hook is called Currently, callers of addchangegroup first acquire the repository lock, usually to check that an unbundle request isn't racing. This means that changegroup hook actions that might write to a repo get stuck waiting for a lock. Here, we add a new optional lock parameter and update all the callers. Post-1.6 we may make it non-optional.
author Matt Mackall <mpm@selenic.com>
date Fri, 25 Jun 2010 13:47:28 -0500
parents 5fe4302cfd72
children 9e1bc1aafdb1
comparison
equal deleted inserted replaced
11441:d74fe370ab04 11442:ee1ed6afac21
337 self.ui.warn(_('updating bookmark %s' 337 self.ui.warn(_('updating bookmark %s'
338 ' failed!\n') % k) 338 ' failed!\n') % k)
339 339
340 return result 340 return result
341 341
342 def addchangegroup(self, source, srctype, url, emptyok=False): 342 def addchangegroup(self, *args, **kwargs):
343 parents = self.dirstate.parents() 343 parents = self.dirstate.parents()
344 344
345 result = super(bookmark_repo, self).addchangegroup( 345 result = super(bookmark_repo, self).addchangegroup(*args, **kwargs)
346 source, srctype, url, emptyok)
347 if result > 1: 346 if result > 1:
348 # We have more heads than before 347 # We have more heads than before
349 return result 348 return result
350 node = self.changelog.tip() 349 node = self.changelog.tip()
351 350