diff mercurial/wireproto.py @ 21600:5e08f3b65510

bundle2: update all ``addpart`` callers to ``newpart`` The new method is what we want in all current cases.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 23 May 2014 15:59:19 -0700
parents 9f3652e851f8
children 0cfda08afd24
line wrap: on
line diff
--- a/mercurial/wireproto.py	Fri May 23 15:54:18 2014 -0700
+++ b/mercurial/wireproto.py	Fri May 23 15:59:19 2014 -0700
@@ -805,9 +805,7 @@
             os.unlink(tempname)
     except bundle2.UnknownPartError, exc:
             bundler = bundle2.bundle20(repo.ui)
-            part = bundle2.bundlepart('B2X:ERROR:UNKNOWNPART',
-                                      [('parttype', str(exc))])
-            bundler.addpart(part)
+            bundler.newpart('B2X:ERROR:UNKNOWNPART', [('parttype', str(exc))])
             return streamres(bundler.getchunks())
     except util.Abort, inst:
         # The old code we moved used sys.stderr directly.
@@ -829,9 +827,7 @@
     except error.PushRaced, exc:
         if getattr(exc, 'duringunbundle2', False):
             bundler = bundle2.bundle20(repo.ui)
-            part = bundle2.bundlepart('B2X:ERROR:PUSHRACED',
-                                      [('message', str(exc))])
-            bundler.addpart(part)
+            bundler.newpart('B2X:ERROR:PUSHRACED', [('message', str(exc))])
             return streamres(bundler.getchunks())
         else:
             return pusherr(str(exc))