##// END OF EJS Templates
extdata: avoid crashing inside subprocess when we get a revset parse error...
Augie Fackler -
r42776:ea6558db default
parent child Browse files
Show More
@@ -1541,7 +1541,12 b' def extdatasource(repo, source):'
1541 1541 pass # we ignore data for nodes that don't exist locally
1542 1542 finally:
1543 1543 if proc:
1544 try:
1544 1545 proc.communicate()
1546 except ValueError:
1547 # This happens if we started iterating src and then
1548 # get a parse error on a line. It should be safe to ignore.
1549 pass
1545 1550 if src:
1546 1551 src.close()
1547 1552 if proc and proc.returncode != 0:
@@ -66,9 +66,14 b' test a zero-exiting source that emits ga'
66 66 > 9de260b1e88e
67 67 > EOF
68 68
69 BUG: this should print the revset parse error
70 $ hg log -qr "extdata(badparse)" 2>&1 | grep ValueError
71 ValueError: Mixing iteration and read methods would lose data
69 It might be nice if this error message mentioned where the bad string
70 came from (eg line X of extdata source S), but the important thing is
71 that we don't crash before we can print the parse error.
72 $ hg log -qr "extdata(badparse)"
73 hg: parse error at 0: not a prefix: +
74 (+---------------------------------------+
75 ^ here)
76 [255]
72 77
73 78 test template support:
74 79
General Comments 0
You need to be logged in to leave comments. Login now