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