--- a/hgfastobs.py Fri Jul 26 16:08:56 2013 -0400
+++ b/hgfastobs.py Fri Jul 26 21:35:56 2013 -0400
@@ -15,6 +15,7 @@
"""
import sys
+from mercurial import base85
from mercurial import commands
from mercurial import extensions
from mercurial import obsolete
@@ -71,6 +72,8 @@
'(descendants(precursors(%ln)) or descendants(%ln)) and hidden()',
outgoing.missing, outgoing.missing)
transmit = []
+ for node in outgoing.missing:
+ transmit.extend(obsolete.precursormarkers(urepo[node]))
for node in boxedges:
transmit.extend(obsolete.successormarkers(urepo[node]))
xmit, total = len(transmit), len(repo.obsstore._all)
@@ -78,17 +81,23 @@
'boxpush: about to transmit %d obsolete markers (%d markers total)\n'
% (xmit, total))
parts, size, chunk = [], 0, 0
+ def transmitmarks():
+ repo.ui.note(
+ 'boxpush: sending a chunk of obsolete markers\n')
+ data = ''.join([obsolete._pack('>B', obsolete._fmversion)] + parts)
+ remote.pushkey('obsolete', 'dump-%d' % chunk, '',
+ base85.b85encode(data))
+
for marker in transmit:
enc = obsolete._encodeonemarker(_markertuple(marker))
parts.append(enc)
size += len(enc)
if size > obsolete._maxpayload:
- repo.ui.note(
- 'boxpush: sending a chunk of obsolete markers\n')
- data = ''.join([obsolete._pack('>B', _fmversion)], parts)
- remote.pushkey('obsolete', 'dump%d' % chunk, base85.b85encode(data))
+ transmitmarks()
parts, size = [], 0
chunk += 1
+ if parts:
+ transmitmarks()
def _markertuple(marker):
return marker._data