Lorem Ipsum
Lorem Ipsum

Reputation: 4534

Mercurial is ignoring new files

How can I make new files show up in hg status output?

Newly created files in my project directory do not appear when I run hg status. If I run hg status --all, I see that they are ignored. I would expect that newly created files would be indicated as untracked and that I would have to manually ignore them, rather than the other way around.

The new file type is not listed in .hgignore nor do I have anything that should affect it in my mercurial.ini.


# .hgignore

syntax: glob

## Specific Files ##

## File Types ##
*~
*.pyc
*\#

## Directories ##
venv/*
.idea/*
.pytest_*
__pycache__/*
*/__pycache__/*

; mercurial.ini

[ui]
username = Lorem Ipsum <[email protected]>
editor = "C:\Program Files\emacs-26.1-x86_64\bin\emacsclientw.exe"

[pager]
pager = C:\Program Files (x86)\less-530-win32-static-x86\less.exe

[color]
mode = win32

[alias]
; Prevents creation of .orig files
undo = revert --no-backup

Upvotes: 1

Views: 108

Answers (1)

Lorem Ipsum
Lorem Ipsum

Reputation: 4534

The trouble is that hash is not escaped correctly in .hgignore.

Incorrect

*#

Correct

*\#

The .hgignore file uses hash for comments. Without it, Mercurial interprets *# as just *. This tells Mercurial to ignore everything! That's why nothing was showing up in hg status.

Upvotes: 3

Related Questions