bundle2: add an error message to push race error stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 21 Apr 2014 20:04:54 -0700
branchstable
changeset 21185 5b3717e1a3ea
parent 21184 28d76afa1568
child 21186 9f3652e851f8
bundle2: add an error message to push race error Errors with no explanations makes my uncle Bob sad.
mercurial/bundle2.py
tests/test-bundle2.t
--- a/mercurial/bundle2.py	Mon Apr 21 18:59:09 2014 -0700
+++ b/mercurial/bundle2.py	Mon Apr 21 20:04:54 2014 -0700
@@ -730,7 +730,8 @@
         h = inpart.read(20)
     assert not h
     if heads != op.repo.heads():
-        raise error.PushRaced()
+        raise error.PushRaced('repository changed while pushing - '
+                              'please try again')
 
 @parthandler('b2x:output')
 def handleoutput(op, inpart):
--- a/tests/test-bundle2.t	Mon Apr 21 18:59:09 2014 -0700
+++ b/tests/test-bundle2.t	Mon Apr 21 20:04:54 2014 -0700
@@ -139,7 +139,7 @@
   >         except KeyError, exc:
   >             raise util.Abort('missing support for %s' % exc)
   >         except error.PushRaced, exc:
-  >             raise util.Abort('push race')
+  >             raise util.Abort('push race: %s' % exc)
   >     finally:
   >         if tr is not None:
   >             tr.release()
@@ -615,7 +615,7 @@
 
   $ hg unbundle2 < ../part-race.hg2
   0 unread bytes
-  abort: push race
+  abort: push race: repository changed while pushing - please try again
   [255]
 
 Support for changegroup