Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 18957:6b618aa08b6e
wireproto: clarify cryptic 'remote: unsynced changes' error message on push
The message was not very much to the point and did not in any way help an
ordinary user.
'repository changed while preparing/uploading bundle - please try again'
is more correct, gives the user some understanding of what is going on, and
tells how to 'recover' from the situation.
The 'bundle' aspect could be seen as an implementation detail that shouldn't be
mentioned, but I think it helps giving an exact error message.
The message could still leave the user wondering why Mercurial doesn't lock the
repo and how unsafe it thus is. Explaining that is however too much detail.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 11 Apr 2013 14:54:18 +0200 |
parents | f3b21beb9802 |
children | aae14b3d0a9c |
comparison
equal
deleted
inserted
replaced
18956:1a9ad84583ee | 18957:6b618aa08b6e |
---|---|
600 | 600 |
601 proto.redirect() | 601 proto.redirect() |
602 | 602 |
603 # fail early if possible | 603 # fail early if possible |
604 if not check_heads(): | 604 if not check_heads(): |
605 return pusherr('unsynced changes') | 605 return pusherr('repository changed while preparing changes - ' |
606 'please try again') | |
606 | 607 |
607 # write bundle data to temporary file because it can be big | 608 # write bundle data to temporary file because it can be big |
608 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') | 609 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') |
609 fp = os.fdopen(fd, 'wb+') | 610 fp = os.fdopen(fd, 'wb+') |
610 r = 0 | 611 r = 0 |
613 lock = repo.lock() | 614 lock = repo.lock() |
614 try: | 615 try: |
615 if not check_heads(): | 616 if not check_heads(): |
616 # someone else committed/pushed/unbundled while we | 617 # someone else committed/pushed/unbundled while we |
617 # were transferring data | 618 # were transferring data |
618 return pusherr('unsynced changes') | 619 return pusherr('repository changed while uploading changes - ' |
620 'please try again') | |
619 | 621 |
620 # push can proceed | 622 # push can proceed |
621 fp.seek(0) | 623 fp.seek(0) |
622 gen = changegroupmod.readbundle(fp, None) | 624 gen = changegroupmod.readbundle(fp, None) |
623 | 625 |