mercurial/bundle2.py
changeset 20950 c7ceae0faf69
parent 20949 571f2903ff1e
child 20952 b24ee5076b94
--- a/mercurial/bundle2.py	Wed Apr 02 22:37:50 2014 -0700
+++ b/mercurial/bundle2.py	Mon Mar 24 19:37:59 2014 -0700
@@ -141,6 +141,7 @@
 import struct
 import urllib
 import string
+import StringIO
 
 import changegroup
 from i18n import _
@@ -524,3 +525,17 @@
         # end of payload
         yield _pack(_fpayloadsize, 0)
 
+@parthandler('changegroup')
+def handlechangegroup(op, part):
+    """apply a changegroup part on the repo
+
+    This is a very early implementation that will massive rework before being
+    inflicted to any end-user.
+    """
+    data = StringIO.StringIO(part.data)
+    data.seek(0)
+    cg = changegroup.readbundle(data, 'bundle2part')
+    ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2')
+    op.records.add('changegroup', {'return': ret})
+
+