diff -r f747c085b789 -r 40bb5853fc4b mercurial/wireproto.py --- a/mercurial/wireproto.py Mon Oct 11 12:44:33 2010 -0500 +++ b/mercurial/wireproto.py Mon Oct 11 12:45:36 2010 -0500 @@ -142,6 +142,10 @@ def __init__(self, res): self.res = res +class pusherr(object): + def __init__(self, res): + self.res = res + def dispatch(repo, proto, command): func, spec = commands[command] args = proto.getargs(spec) @@ -285,7 +289,7 @@ # fail early if possible if not check_heads(): - return 'unsynced changes' + return pusherr('unsynced changes') # write bundle data to temporary file because it can be big fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') @@ -298,7 +302,7 @@ if not check_heads(): # someone else committed/pushed/unbundled while we # were transferring data - return 'unsynced changes' + return pusherr('unsynced changes') # push can proceed fp.seek(0)