##// END OF EJS Templates
convert: use repo._bookmarks.recordchange instead of repo._bookmarks.write...
Laurent Charignon -
r26974:4b5dc0d9 default
parent child Browse files
Show More
@@ -23,6 +23,7 b' from mercurial.i18n import _'
23 from mercurial.node import bin, hex, nullid
23 from mercurial.node import bin, hex, nullid
24 from mercurial import hg, util, context, bookmarks, error, scmutil, exchange
24 from mercurial import hg, util, context, bookmarks, error, scmutil, exchange
25 from mercurial import phases
25 from mercurial import phases
26 from mercurial import lock as lockmod
26 from mercurial import merge as mergemod
27 from mercurial import merge as mergemod
27
28
28 from common import NoRepo, commit, converter_source, converter_sink, mapfile
29 from common import NoRepo, commit, converter_source, converter_sink, mapfile
@@ -410,12 +411,19 b' class mercurial_sink(converter_sink):'
410 def putbookmarks(self, updatedbookmark):
411 def putbookmarks(self, updatedbookmark):
411 if not len(updatedbookmark):
412 if not len(updatedbookmark):
412 return
413 return
413 if True:
414 wlock = lock = tr = None
415 try:
416 wlock = self.repo.wlock()
417 lock = self.repo.lock()
418 tr = self.repo.transaction('bookmark')
414 self.ui.status(_("updating bookmarks\n"))
419 self.ui.status(_("updating bookmarks\n"))
415 destmarks = self.repo._bookmarks
420 destmarks = self.repo._bookmarks
416 for bookmark in updatedbookmark:
421 for bookmark in updatedbookmark:
417 destmarks[bookmark] = bin(updatedbookmark[bookmark])
422 destmarks[bookmark] = bin(updatedbookmark[bookmark])
418 destmarks.write()
423 destmarks.recordchange(tr)
424 tr.close()
425 finally:
426 lockmod.release(lock, wlock, tr)
419
427
420 def hascommitfrommap(self, rev):
428 def hascommitfrommap(self, rev):
421 # the exact semantics of clonebranches is unclear so we can't say no
429 # the exact semantics of clonebranches is unclear so we can't say no
General Comments 0
You need to be logged in to leave comments. Login now