Bug 1572072 - Disable the `format-source` extension since it served it's purpose for Prettier, r=sheehan
authorVictor Porof <vporof@mozilla.com>
Wed, 07 Aug 2019 14:01:20 +0000
changeset 7148 01ef6e45d82167bc173c4c651c6646d2ea8f1267
parent 7147 9efa8e908c258d269d6c63ff2b2233899af31eef
child 7149 307f3c28687630bf91b4c19c913f0c677e0ae724
push id3557
push usercosheehan@mozilla.com
push dateWed, 07 Aug 2019 14:25:16 +0000
treeherderversion-control-tools@01ef6e45d821 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssheehan
bugs1572072
Bug 1572072 - Disable the `format-source` extension since it served it's purpose for Prettier, r=sheehan Differential Revision: https://phabricator.services.mozilla.com/D40998
hgext/configwizard/__init__.py
hgext/configwizard/tests/test-format-source.t
--- a/hgext/configwizard/__init__.py
+++ b/hgext/configwizard/__init__.py
@@ -788,17 +788,17 @@ def _checkcolor(ui, cw, hg_version):
                      'by default in Mercurial 4.2+\n')
             del ext['color']
     else:
         _promptnativeextension(ui, cw, 'color',
                                'Enable color output to your terminal')
 
 
 def _checkformatsource(ui, cw):
-    disable_format_source = False
+    disable_format_source = True
 
     if disable_format_source:
         ext = cw.c.get('extensions', {})
         if 'format-source' in ext:
             ui.write(FORMATSOURCE_DISABLE_INFO)
             del ext['format-source']
     else:
         _promptvctextension(ui, cw, 'format-source', FORMATSOURCE_INFO)
--- a/hgext/configwizard/tests/test-format-source.t
+++ b/hgext/configwizard/tests/test-format-source.t
@@ -1,90 +1,52 @@
   $ . $TESTDIR/hgext/configwizard/tests/helpers.sh
 
-Rejecting format-source doesn't enable it
+When not loading format-source we should not get the removal message.
 
-  $ hg --config ui.interactive=true --config configwizard.steps=format-source,configchange configwizard << EOF
+  $ hg --config ui.interactive=true --config configwizard.steps=format-source configwizard << EOF
   > 
   > n
   > EOF
   This wizard will guide you through configuring Mercurial for an optimal
   experience contributing to Mozilla projects.
   
   The wizard makes no changes without your permission.
   
   To begin, press the enter/return key.
    <RETURN>
-  The "format-source" extension provides a way to run code-formatting tools in a way that
-  avoids conflicts related to this formatting when merging/rebasing code across the
-  reformatting.
-  An example of a .hgrc configuration that uses our embedded clang-format and prettier-format
-  utilities from 'mach' is as follows:
-  [format-source]
-  clang-format = [Path To Mozilla Repo]/mach clang-format --assume-filename $HG_FILENAME -p
-  clang-format:configpaths = .clang-format, .clang-format-ignore
-  clang-format:fileext = .cpp, .c, .h
-  prettier-format = [Path To Mozilla Repo]/mach prettier-format --assume-filename $HG_FILENAME -p
-  prettier-format:configpaths = .prettierrc, .prettierignore
-  prettier-format:fileext = .js, .jsx, .jsm
-  
-  If `clang-format` or `prettier-format` are not present under `[format-source]`, a default
-  configuration will be used that is embedded in this extension. The default configuration
-  can be used in most cases.
-  Would you like to activate format-source (Yn)?  n
-No prompt if extensions already enabled
+Remove extension when already enabled
 
-  $ hg --config configwizard.steps=format-source --config extensions.format-source=$TESTDIR/hgext/format-source configwizard
-  This wizard will guide you through configuring Mercurial for an optimal
-  experience contributing to Mozilla projects.
-  
-  The wizard makes no changes without your permission.
-  
-  To begin, press the enter/return key.
-   <RETURN>
-
-
-
-format-source enabled when requested
+  $ cat >> .hgrc << EOF
+  > [extensions]
+  > format-source = $TESTDIR/hgext/format-source
+  > EOF
 
   $ hg --config configwizard.steps=format-source,configchange configwizard
   This wizard will guide you through configuring Mercurial for an optimal
   experience contributing to Mozilla projects.
   
   The wizard makes no changes without your permission.
   
   To begin, press the enter/return key.
    <RETURN>
-  The "format-source" extension provides a way to run code-formatting tools in a way that
-  avoids conflicts related to this formatting when merging/rebasing code across the
-  reformatting.
-  An example of a .hgrc configuration that uses our embedded clang-format and prettier-format
-  utilities from 'mach' is as follows:
-  [format-source]
-  clang-format = [Path To Mozilla Repo]/mach clang-format --assume-filename $HG_FILENAME -p
-  clang-format:configpaths = .clang-format, .clang-format-ignore
-  clang-format:fileext = .cpp, .c, .h
-  prettier-format = [Path To Mozilla Repo]/mach prettier-format --assume-filename $HG_FILENAME -p
-  prettier-format:configpaths = .prettierrc, .prettierignore
-  prettier-format:fileext = .js, .jsx, .jsm
   
-  If `clang-format` or `prettier-format` are not present under `[format-source]`, a default
-  configuration will be used that is embedded in this extension. The default configuration
-  can be used in most cases.
-  Would you like to activate format-source (Yn)?  y
+  Removing extensions.format-source since it's no longer needed. For the moment we
+  want to disable format-source since the big format of Gecko has been performed.
+  We will re-enable this when we will need it again.
+  
   Your config file needs updating.
   Would you like to see a diff of the changes first (Yn)?  y
   --- hgrc.old
   +++ hgrc.new
-  @@ -0,0 +1,2 @@
-  +[extensions]
-  +format-source = */hgext/format-source (glob)
+  @@ -1,2 +1 @@
+   [extensions]
+  -format-source = */hgext/format-source (glob)
   
   Write changes to hgrc file (Yn)?  y
 
 
 
 
 
 
   $ cat .hgrc
   [extensions]
-  format-source = */hgext/format-source (glob)