# HG changeset patch # User Patrick Mezard # Date 1255641330 -7200 # Node ID d80a251baf9a15c1a81726f6b77330557b743938 # Parent d08099e74b819ae4b9d4faf1c55b5eefc218584f convert/svn: better error when hg cannot call itself (issue1838) diff -r d08099e74b81 -r d80a251baf9a hgext/convert/subversion.py --- a/hgext/convert/subversion.py Thu Oct 15 23:15:30 2009 +0200 +++ b/hgext/convert/subversion.py Thu Oct 15 23:15:30 2009 +0200 @@ -115,7 +115,11 @@ def __iter__(self): while True: - entry = pickle.load(self._stdout) + try: + entry = pickle.load(self._stdout) + except EOFError: + raise util.Abort(_('Mercurial failed to run itself, check' + ' hg executable is in PATH')) try: orig_paths, revnum, author, date, message = entry except: diff -r d08099e74b81 -r d80a251baf9a tests/test-convert-svn-branches --- a/tests/test-convert-svn-branches Thu Oct 15 23:15:30 2009 +0200 +++ b/tests/test-convert-svn-branches Thu Oct 15 23:15:30 2009 +0200 @@ -28,3 +28,7 @@ hg branches | sed 's/:.*/:/' hg tags -q cd .. + +echo '% test hg failing to call itself' +HG=foobar hg convert svn-repo B-hg 2>&1 | grep -v foobar + diff -r d08099e74b81 -r d80a251baf9a tests/test-convert-svn-branches.out --- a/tests/test-convert-svn-branches.out Thu Oct 15 23:15:30 2009 +0200 +++ b/tests/test-convert-svn-branches.out Thu Oct 15 23:15:30 2009 +0200 @@ -48,3 +48,6 @@ old 9: old2 8: tip +% test hg failing to call itself +initializing destination B-hg repository +abort: Mercurial failed to run itself, check hg executable is in PATH