[PATCH 10 of 12 stable] bundle2: add an error message to push race error

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


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1398135894 25200
#      Mon Apr 21 20:04:54 2014 -0700
# Branch stable
# Node ID 58b0fd92f3e411f68dbf9c6e129d895df5336902
# Parent  8b5be208d6b83c89f8a58ddf959bffaaab482c40
bundle2: add an error message to push race error

Errors with no explanations makes my uncle Bob sad.

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -728,11 +728,12 @@ def handlechangegroup(op, inpart):
     while len(h) == 20:
         heads.append(h)
         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):
     """forward output captured on the server to the client"""
     for line in inpart.read().splitlines():
diff --git a/tests/test-bundle2.t b/tests/test-bundle2.t
--- a/tests/test-bundle2.t
+++ b/tests/test-bundle2.t
@@ -137,11 +137,11 @@ Create an extension to test bundle2 API
   >             op = bundle2.processbundle(repo, unbundler, lambda: tr)
   >             tr.close()
   >         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()
   >         lock.release()
   >         remains = sys.stdin.read()
@@ -613,11 +613,11 @@ Test push race detection
 
   $ hg bundle2 --pushrace ../part-race.hg2
 
   $ 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
 ===================================
 


More information about the Mercurial-devel mailing list