diff hgext/evolve.py @ 1212:2c1b6e2ec59a

merge with stable
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 13 Mar 2015 10:49:02 -0700
parents 9523c027a240
children 7118996bdf43
line wrap: on
line diff
--- a/hgext/evolve.py	Thu Mar 05 10:52:01 2015 -0800
+++ b/hgext/evolve.py	Fri Mar 13 10:49:02 2015 -0700
@@ -1422,8 +1422,14 @@
         files = set()
         copied = copies.pathcopies(prec, bumped)
         precmanifest = prec.manifest()
-        for key, val in bumped.manifest().items():
-            if precmanifest.pop(key, None) != val:
+        # 3.3.2 needs a list.
+        # future 3.4 don't detect the size change during iteration
+        # this is fishy
+        for key, val in list(bumped.manifest().iteritems()):
+            precvalue = precmanifest.get(key, None)
+            if precvalue is not None:
+                del precmanifest[key]
+            if precvalue != val:
                 files.add(key)
         files.update(precmanifest)  # add missing files
         # commit it
@@ -2519,11 +2525,20 @@
     (Cannot simply use _callpush as http is doing some special handling)"""
     self.requirecap('_evoext_pushobsmarkers_0',
                     _('push obsolete markers faster'))
-    ret, output = self._call('evoext_pushobsmarkers_0', data=obsfile)
-    for l in output.splitlines(True):
-        if l.strip():
-            self.ui.status(_('remote: '), l)
-    return ret
+    try:
+        r = self._call('evoext_pushobsmarkers_0', data=obsfile)
+        vals = r.split('\n', 1)
+        if len(vals) < 2:
+            raise error.ResponseError(_("unexpected response:"), r)
+
+        for l in vals[1].splitlines(True):
+            if l.strip():
+                self.ui.status(_('remote: '), l)
+        return vals[0]
+    except socket.error, err:
+        if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
+            raise util.Abort(_('push failed: %s') % err.args[1])
+        raise util.Abort(err.args[1])
 
 @eh.wrapfunction(localrepo.localrepository, '_restrictcapabilities')
 def local_pushobsmarker_capabilities(orig, repo, caps):