Better error messages for failed commands #60
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two related changes here:
For any failed command run via
execute_subprocess, print moreinformation about the problem to stdout
After doing an
svn switch, check the status of the resultingrepository; if dirty, abort with a helpful message
The immediate purpose of both of these is to give more helpful error
messages if there are failures due to the presence of untracked files,
now that we attempt a checkout even if there are untracked files (via
#57). If there is an
untracked file in the working directory that would get overwritten by a
tracked file in the new version:
git aborts the
checkoutwith an error code; the new informationprinted by (1) will help users in this case
svn attempts the
checkoutand returns a 0 error status, but mayleave you in a conflict state; we check this via (2)
Note that (2) should never happen currently (due to the up-front
conservative check of the repository status, which doesn't even allow
untracked files), but it will become possible after
#57.
User interface changes?: No
Testing:
new unit tests added for some utility functions
unit tests: pass
system tests: pass
manual testing: For both git and svn, tested having an untracked file
in the working directory that gets overwritten after checking out a
new branch; did this testing on top of the changes in
#57
Here is sample output when git refuses to do the checkout:
And for svn: