[extensions] foo = C:\bar\foo -> Succeeds. [extensions] foo = C:\bar\foo\ *** failed to import extension foo from C:\bar\foo\: No module named The cause is the OS specific strip here: http://selenic.com/hg/file/779ceb84f4f7/mercurial/extensions.py#l49 > d, f = os.path.split(path.rstrip('/')) This was added by: http://selenic.com/hg/rev/5c794e7331e7 Looks like it wasn't intentionally OS-specific. We should just switch to using os.path.sep
Patch at: http://selenic.com/pipermail/mercurial-devel/2014-March/056783.html
Replaced os.sep with normpath otherwise we lose support for paths with trailing forward slashes on Windows, which whilst presumably less common, we want to maintain.
Updated extensions wiki page to mention trailing backwards slash needs to be omitted on current release on Windows: http://mercurial.selenic.com/wiki/UsingExtensions?action=diff&rev1=327&rev2=328 Will update again with version numbers once this is released.
Fixed by http://selenic.com/repo/hg/rev/7d83c3b6e8d9 Ed Morley <emorley@mozilla.com> extensions: use normpath to allow trailing '\' on Windows (issue4187) Fixes same issue as 5c794e7331e7 but now works on Windows too. With this patch a trailing backward slash won't prevent the extension from being found on Windows, and we continue to support any combination of forward and back slashes within the path. (please test the fix)
http://mercurial.selenic.com/wiki/WhatsNew#Mercurial_3.0_.282014-05-01.29 Confirmed fixed with the TortoiseHg v3.0 release (that ships with hg 3.0+3).