Bug 977414 - mach mercurial-setup: Fix hgrc paths for extensions on Windows; r=gps
authorEd Morley <emorley@mozilla.com>
Thu, 27 Feb 2014 10:10:22 +0000
changeset 171267 835210e4384c8db549f932dd869589d657bad3e9
parent 171266 5fae30b6968ffc1041ab114103c9f1e6889b1de8
child 171268 4d62486d28880f4cfc706b0cb8a7c991238b5d26
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersgps
bugs977414
milestone30.0a1
Bug 977414 - mach mercurial-setup: Fix hgrc paths for extensions on Windows; r=gps
tools/mercurial/hgsetup/wizard.py
--- a/tools/mercurial/hgsetup/wizard.py
+++ b/tools/mercurial/hgsetup/wizard.py
@@ -87,19 +87,21 @@ Your Mercurial should now be properly co
 should be up to date!
 '''.strip()
 
 
 class MercurialSetupWizard(object):
     """Command-line wizard to help users configure Mercurial."""
 
     def __init__(self, state_dir):
-        self.state_dir = state_dir
-        self.ext_dir = os.path.join(state_dir, 'mercurial', 'extensions')
-        self.vcs_tools_dir = os.path.join(state_dir, 'version-control-tools')
+        # We use normpath since Mercurial expects the hgrc to use native path
+        # separators, but state_dir uses unix style paths even on Windows.
+        self.state_dir = os.path.normpath(state_dir)
+        self.ext_dir = os.path.join(self.state_dir, 'mercurial', 'extensions')
+        self.vcs_tools_dir = os.path.join(self.state_dir, 'version-control-tools')
         self.update_vcs_tools = False
 
     def run(self, config_paths):
         try:
             os.makedirs(self.ext_dir)
         except OSError as e:
             if e.errno != errno.EEXIST:
                 raise