Allow destination paths in the hg module to include a tilde (~)

Fixes issue #3360 - Inconsistent behavior of the hg module w.r.t. dest path
Merge pull request #3744 from jimi1283/issue_3360

Allow destination paths in the hg module to include a tilde (~)