convert/svn: better error when hg cannot call itself (
issue1838)
--- 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:
--- 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
+
--- 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