Bug 1200458 - Skip permission check for .hgrc on Windows in hgsetup wizard. r=gps DONTBUILD
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 01 Sep 2015 10:22:45 +1000
changeset 260241 f05b06b50a39b0d1691d5f8775fc9764a1577dcd
parent 260240 f4ba4b6e7c951960588c09971726d653845220be
child 260242 e90965135940c77f0f88e83dbd4ab8a7aaaa687e
push id29304
push usercbook@mozilla.com
push dateTue, 01 Sep 2015 12:32:25 +0000
treeherdermozilla-central@dd509db16a13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1200458
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1200458 - Skip permission check for .hgrc on Windows in hgsetup wizard. r=gps DONTBUILD
tools/mercurial/hgsetup/wizard.py
--- a/tools/mercurial/hgsetup/wizard.py
+++ b/tools/mercurial/hgsetup/wizard.py
@@ -439,28 +439,29 @@ class MercurialSetupWizard(object):
                     c.write(fh)
                 print('Wrote changes to %s.' % config_path)
             else:
                 print('hgrc changes not written to file. I would have '
                     'written the following:\n')
                 c.write(sys.stdout)
                 return 1
 
-        # Config file may contain sensitive content, such as passwords.
-        # Prompt to remove global permissions.
-        mode = os.stat(config_path).st_mode
-        if mode & (stat.S_IRWXG | stat.S_IRWXO):
-            print(FILE_PERMISSIONS_WARNING)
-            if self._prompt_yn('Remove permissions for others to read '
-                               'your hgrc file'):
-                # We don't care about sticky and set UID bits because this is
-                # a regular file.
-                mode = mode & stat.S_IRWXU
-                print('Changing permissions of %s' % config_path)
-                os.chmod(config_path, mode)
+        if sys.platform != 'win32':
+            # Config file may contain sensitive content, such as passwords.
+            # Prompt to remove global permissions.
+            mode = os.stat(config_path).st_mode
+            if mode & (stat.S_IRWXG | stat.S_IRWXO):
+                print(FILE_PERMISSIONS_WARNING)
+                if self._prompt_yn('Remove permissions for others to '
+                                   'read your hgrc file'):
+                    # We don't care about sticky and set UID bits because
+                    # this is a regular file.
+                    mode = mode & stat.S_IRWXU
+                    print('Changing permissions of %s' % config_path)
+                    os.chmod(config_path, mode)
 
         print(FINISHED)
         return 0
 
     def prompt_native_extension(self, c, name, prompt_text):
         # Ask the user if the specified extension bundled with Mercurial should be enabled.
         if name in c.extensions:
             return