# HG changeset patch # User Danny Hooper # Date 2019-03-22 01:35:39 # Node ID 7f6b375a89031740657d96f948cde4d8b06e9b5d # Parent b5511845f9d5743ea396f5db52d659c6790e19a6 fix: allow fixing untracked files when given as arguments It's more useful to fix the file than to silently avoid it when the user does this: hg fix --working-dir untracked-file We will still do nothing to ignored files, even if they are specified. This may be safer, given that such files can unexpectedly slip into the arguments via a shell glob or fileset. Differential Revision: https://phab.mercurial-scm.org/D6165 diff --git a/hgext/fix.py b/hgext/fix.py --- a/hgext/fix.py +++ b/hgext/fix.py @@ -282,8 +282,6 @@ def getworkqueue(ui, repo, pats, opts, r match = scmutil.match(fixctx, pats, opts) for path in pathstofix(ui, repo, pats, opts, match, basectxs[rev], fixctx): - if path not in fixctx: - continue fctx = fixctx[path] if fctx.islink(): continue diff --git a/tests/test-fix.t b/tests/test-fix.t --- a/tests/test-fix.t +++ b/tests/test-fix.t @@ -354,6 +354,10 @@ and without providing explicit file argu $ printf "modified!!!\n" > modified.whole $ printf "added\n" > added.whole + +Listing the files explicitly causes untracked files to also be fixed, but +ignored files are still unaffected. + $ hg fix --working-dir *.whole $ hg status --all @@ -366,13 +370,12 @@ and without providing explicit file argu I ignored.whole C .hgignore -It would be better if this also fixed the unknown file. $ cat *.whole ADDED CLEAN ignored MODIFIED!!! - unknown + UNKNOWN $ cd ..