Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 254
JamesWampler Avatar asked Jun 08 '10 18:06

JamesWampler


People also ask

What is hg repository?

Strictly speaking, the term repository refers to the directory named . hg (dot hg) in the repository root directory. The repository root directory is the parent directory of the . hg directory. Mercurial stores its internal data structures – the metadata – inside that .

What is .hg folder?

hg folder keeps track of one repo only. If you've got one in your home directory it means your home directory is under version control.

How do I Untrack a file in Mercurial?

If you see the help for hg rm --help : hg remove [OPTION]... FILE... Schedule the indicated files for removal from the current branch. This command schedules the files to be removed at the next commit.


1 Answers

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.

like image 86
Ned Batchelder Avatar answered Sep 20 '22 12:09

Ned Batchelder