Mercurial > hg
comparison mercurial/scmutil.py @ 42576:ea6558db1011
extdata: avoid crashing inside subprocess when we get a revset parse error
Differential Revision: https://phab.mercurial-scm.org/D6616
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 08 Jul 2019 14:01:01 -0400 |
parents | 88ba0ff94605 |
children | 87c4cd89b539 |
comparison
equal
deleted
inserted
replaced
42575:eec65b706caf | 42576:ea6558db1011 |
---|---|
1539 data[revsingle(repo, k).rev()] = encoding.tolocal(v) | 1539 data[revsingle(repo, k).rev()] = encoding.tolocal(v) |
1540 except (error.LookupError, error.RepoLookupError): | 1540 except (error.LookupError, error.RepoLookupError): |
1541 pass # we ignore data for nodes that don't exist locally | 1541 pass # we ignore data for nodes that don't exist locally |
1542 finally: | 1542 finally: |
1543 if proc: | 1543 if proc: |
1544 proc.communicate() | 1544 try: |
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 if src: | 1550 if src: |
1546 src.close() | 1551 src.close() |
1547 if proc and proc.returncode != 0: | 1552 if proc and proc.returncode != 0: |
1548 raise error.Abort(_("extdata command '%s' failed: %s") | 1553 raise error.Abort(_("extdata command '%s' failed: %s") |
1549 % (cmd, procutil.explainexit(proc.returncode))) | 1554 % (cmd, procutil.explainexit(proc.returncode))) |