Patchwork D7085: fix: warn when a fixer doesn't have a configured command

login
register
mail settings
Submitter phabricator
Date Oct. 14, 2019, 5:10 p.m.
Message ID <1790ad54e014a3440c859c04f4582cea@localhost.localdomain>
Download mbox | patch
Permalink /patch/42328/
State Not Applicable
Headers show

Comments

phabricator - Oct. 14, 2019, 5:10 p.m.
Closed by commit rHG99f2d939f03c: fix: warn when a fixer doesn&#039;t have a configured command (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7085?vs=17130&id=17143

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7085/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7085

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1338,6 +1338,8 @@ 
   fixer tool has no pattern configuration: nopattern
   $ cat foo bar
   foobar (no-eol)
+  $ hg fix --debug --working-dir --config "fix.nocommand:pattern=foo.bar"
+  fixer tool has no command configuration: nocommand
 
   $ cd ..
 
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -802,7 +802,11 @@ 
         # dangerous to let it affect all files. It would be pointless to let it
         # affect no files. There is no reasonable subset of files to use as the
         # default.
-        if pattern is None:
+        if command is None:
+            ui.warn(
+                _(b'fixer tool has no command configuration: %s\n') % (name,)
+            )
+        elif pattern is None:
             ui.warn(
                 _(b'fixer tool has no pattern configuration: %s\n') % (name,)
             )