Fixes and improvements to PersistentClient #9
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.
Change
Execute()
so that it doesn't throw an exception saying "Unable to decode output from executing command..." for non-zero return codes and empty output. This allows regular Mercurial errors to be reported like they would in the non-persistent client. This also eliminates the exception when running the incoming and outgoing commands when there are no incoming or outgoing commits triggered by the return code of 1.Change
IsSupported()
to not require the existence of a ".hg" folder under the repositoryPath. This allow the persistent client to be used in more cases, like when calling "hg init". This also allows more unit tests to use the persistent client when the "PERSISTENTCLIENT" environment variable is set to "1".Trim quotes on arguments to "runcommand". For the non-persistent client, for arguments passed to
WithAdditionalArgument()
that contain spaces, you need to wrap the argument in quotes for the command processor to interpret the argument correctly. On the other hand, in the persistent client, quoted arguments can result in errors. By trimming quotes automatically in the persistent client, one set of arguments can work for both clients. This also fixes some unit test failures due to quoted arguments when the "PERSISTENTCLIENT" environment variable is set to "1".Remove unused command encoding code that itself trimmed quotes from arguments, but was not actually being used.