[PATCH 07 of 12 stable] bundle2: catch UnknownPartError during local push

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Tue Apr 22 15:10:51 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1398192094 25200
#      Tue Apr 22 11:41:34 2014 -0700
# Branch stable
# Node ID 6ab6a29964dbf3113ba85f1d8755610eb03e283f
# Parent  4c01060d31545244d980895ab9c29e9268e685be
bundle2: catch UnknownPartError during local push

When doing local push, UnknownPartError from the server will be raised directly
to the client. We need to catch them too.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -223,11 +223,14 @@ def _pushbundle2(pushop):
     # add the changegroup bundle
     cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
     cgpart = bundle2.bundlepart('B2X:CHANGEGROUP', data=cg.getchunks())
     bundler.addpart(cgpart)
     stream = util.chunkbuffer(bundler.getchunks())
-    reply = pushop.remote.unbundle(stream, ['force'], 'push')
+    try:
+        reply = pushop.remote.unbundle(stream, ['force'], 'push')
+    except bundle2.UnknownPartError, exc:
+        raise util.Abort('missing support for %s' % exc)
     try:
         op = bundle2.processbundle(pushop.repo, reply)
     except bundle2.UnknownPartError, exc:
         raise util.Abort('missing support for %s' % exc)
     cgreplies = op.records.getreplies(cgpart.id)


More information about the Mercurial-devel mailing list