Patchwork [05,of,12,stable] bundle2: catch UnknownPartError during push

login
register
mail settings
Submitter Pierre-Yves David
Date April 22, 2014, 8:10 p.m.
Message ID <54099a51da15a7663824.1398197449@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4424/
State Accepted
Commit b056777221bf4e44dbd97b84ba3e086e4aa5a5c6
Headers show

Comments

Pierre-Yves David - April 22, 2014, 8:10 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1398134571 25200
#      Mon Apr 21 19:42:51 2014 -0700
# Branch stable
# Node ID 54099a51da15a76638242be65943054ffe48a663
# Parent  574682bc8678be8e42609396f418448a5942c1ce
bundle2: catch UnknownPartError during push

We narrow the exception catching while unbundling the push reply.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -226,11 +226,11 @@  def _pushbundle2(pushop):
     bundler.addpart(cgpart)
     stream = util.chunkbuffer(bundler.getchunks())
     reply = pushop.remote.unbundle(stream, ['force'], 'push')
     try:
         op = bundle2.processbundle(pushop.repo, reply)
-    except KeyError, exc:
+    except bundle2.UnknownPartError, exc:
         raise util.Abort('missing support for %s' % exc)
     cgreplies = op.records.getreplies(cgpart.id)
     assert len(cgreplies['changegroup']) == 1
     pushop.ret = cgreplies['changegroup'][0]['return']
     _pushbundle2extrareply(pushop, op, extrainfo)