How to list all files in a repository in Mercurial (hg)?

JamesWampler picture JamesWampler · Jun 8, 2010 · Viewed 25.8k times · Source

Is there a command in mercurial that will list all files currently under source control?

I can do a dir /s to list all files in my folder and subfolders, but I have no idea which have been added to my repository. I have a variety of excluded file types and folders and I want verify that none of them were added before I set them up in my .hgignore file.

Answer

Ned Batchelder picture Ned Batchelder · Jun 8, 2010

hg status --all will list all the files in the tree, with a letter indicating its status: M for modified, C for clean (owned by hg), and I for ignored.

For just ignored files, use hg status -i. For just files that will be added on the next commit, use hg status -a. These show only what you need to know and don't require scanning a long file list.