# HG changeset patch # User Pierre-Yves David # Date 1409153118 -7200 # Node ID dddb8a70437c20b1f6b82f15a09a9d299b9d636f # Parent 41d2555141ea2467b241abdf8e8be8804a507d0e obsexc: add support for evoext_pushobsmarkers_0 on localpeer This will unify the behavior of exchange in the tests. diff -r 41d2555141ea -r dddb8a70437c hgext/evolve.py --- a/hgext/evolve.py Wed Aug 27 17:24:40 2014 +0200 +++ b/hgext/evolve.py Wed Aug 27 17:25:18 2014 +0200 @@ -2503,6 +2503,26 @@ self.ui.status(_('remote: '), l) return ret +@eh.wrapfunction(localrepo.localrepository, '_restrictcapabilities') +def local_pushobsmarker_capabilities(orig, repo, caps): + caps = orig(repo, caps) + caps.add('_evoext_pushobsmarkers_0') + return caps + +@eh.addattr(localrepo.localpeer, 'evoext_pushobsmarkers_0') +def local_pushobsmarkers(peer, obsfile): + data = obsfile.read() + lock = peer._repo.lock() + try: + tr = peer._repo.transaction('pushkey: obsolete markers') + try: + peer._repo.obsstore.mergemarkers(tr, data) + tr.close() + finally: + tr.release() + finally: + lock.release() + peer._repo.hook('evolve_pushobsmarkers') def srv_pushobsmarkers(repo, proto): """wireprotocol command"""