Patchwork D6165: fix: allow fixing untracked files when given as arguments

login
register
mail settings
Submitter phabricator
Date March 23, 2019, 3:46 p.m.
Message ID <371bfbb5f317066f31b9b2f66cc4b6c4@localhost.localdomain>
Download mbox | patch
Permalink /patch/39375/
State Not Applicable
Headers show

Comments

phabricator - March 23, 2019, 3:46 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7f6b375a8903: fix: allow fixing untracked files when given as arguments (authored by hooper, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6165?vs=14579&id=14590

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

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

CHANGE DETAILS




To: hooper, #hg-reviewers
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
@@ -354,6 +354,10 @@ 
 
   $ 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 @@ 
   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 ..
 
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -282,8 +282,6 @@ 
         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