comparison mercurial/localrepo.py @ 17125:95d785ccb4e5

obsolete: append new markers to obsstore file instead of rewriting everything This is the second step toward incremental writing of marker inside a transaction. The obsstore file is now handled append only. Header writing have been extracted from _writemarkers. Because the _writemarkers method have been dropped, the push code directly reuse the serialised content of local repo `listkeys`. This is not very pretty, but this part of the protocol still need major improvement anyway.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 04 Jul 2012 02:02:48 +0200
parents f1b7683f3f95
children 8fa8717b47b6
comparison
equal deleted inserted replaced
17124:f1b7683f3f95 17125:95d785ccb4e5
1806 str(phases.public)) 1806 str(phases.public))
1807 if not r: 1807 if not r:
1808 self.ui.warn(_('updating %s to public failed!\n') 1808 self.ui.warn(_('updating %s to public failed!\n')
1809 % newremotehead) 1809 % newremotehead)
1810 if 'obsolete' in self.listkeys('namespaces') and self.obsstore: 1810 if 'obsolete' in self.listkeys('namespaces') and self.obsstore:
1811 data = self.obsstore._writemarkers() 1811 data = self.listkeys('obsolete')['dump']
1812 r = remote.pushkey('obsolete', 'dump', '', 1812 r = remote.pushkey('obsolete', 'dump', '', data)
1813 base85.b85encode(data))
1814 if not r: 1813 if not r:
1815 self.ui.warn(_('failed to push obsolete markers!\n')) 1814 self.ui.warn(_('failed to push obsolete markers!\n'))
1816 finally: 1815 finally:
1817 if lock is not None: 1816 if lock is not None:
1818 lock.release() 1817 lock.release()