Adding a possibility to configure error hint to be shown in the case of problems with SSH. Example of such hint can be "Please see http://company/internalwiki/ssh.html".
Details
- Reviewers
durham mitrandir durin42 - Group Reviewers
hg-reviewers - Commits
- rHG8b1c887d52e7: sshpeer: add a configurable hint for the ssh error message
- Ran hg pull with broken link and verified the output has no hint by default:
pulling from ssh://brokenrepository.com//repo remote: ssh: Could not resolve hostname brokenrepository.com: Name or service not known abort: no suitable response from remote hg!
- Run hg pull --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html":
pulling from ssh://brokenrepository.com//repo remote: ssh: Could not resolve hostname brokenrepository.com: Name or service not known abort: no suitable response from remote hg! (Please see http://company/internalwiki/ssh.html)
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
mercurial/sshpeer.py | ||
---|---|---|
210 | The standard Mercurial way to format this would be something like: msg = self.ui.config("ssh", "errormessage", _("no suitable response from remote hg")) self._abort(error.RepoError(msg)) | |
tests/test-ssh.t | ||
314 ↗ | (On Diff #3542) | These lines seem unrelated to your change and therefore probably shouldn't have changed. Usually this is caused by your editor trying to remove trailing whitespace from a file, then run-tests -i adding the missing new line back in. Can you undo these new line changes? 'hg uncommit tests/test-ssh.t && hg commit -i' could make it pretty straightforward. |
447 ↗ | (On Diff #3542) | Same for this type of change |
I'd also update the commit summary with an example of what a better message might be. Like "there was an ssh error, please see http://company/internalwiki/ssh.html"
So the purpose of this change is quite similar to ui.supportcontact, right?
My two cents. I think it's probably better to make an additional hint configurable,
instead of replacing the original message.
mercurial/sshpeer.py | ||
---|---|---|
207–211 | new config needs to be registered to the configitems module. |
D'oh: this also needs to be documented, probably in hg help config. That's from mercurial/help/config.txt - hopefully it'll be fairly straightforward to add?
The standard Mercurial way to format this would be something like: