


Unintrusive workarounds that you can use to achieve anĪppropriate effect. Trivial distinction, but it has one minor practicalĬonsequence: it is not possible to represent a completelyĮmpty directories are rarely useful, and there are Before creating a file, itįirst creates any missing directory components of the path.Īfter it deletes a file, it then deletes any empty directories Mercurial does not track directory information. This behavior is common to most Mercurial commands. This makes it more clear what is happening,Īnd reduces the likelihood of a silent and nasty surprise. That Mercurial makes in such cases is that we know what weĪre doing, and it doesn't print any output.įiles by giving the name of a directory, Mercurial takes theĮxtra step of printing the name of each file that it does Named the file to add on the command line. What's going on is that in the former case, we explicitly We added the file named myfile.txt in the The names of the files it added, whereas it didn't do so when Notice in this example that Mercurial printed $ hg commit -m 'Added all files in subdirectory' $ mkdir b $ echo b > b/somefile.txt $ echo c > b/source.cpp $ mkdir b/d $ echo d > b/d/test.h $ hg add b Will treat this as “ I want to operate on every file in The name of a directory to a command, every Mercurial command To track the changes you make to the file every time you commit,Ī useful behavior that Mercurial has is that if you pass State the next time you perform a commit. Instead, it will take a snapshot of the file's Once you add a file, Mercurial doesn't do anything with it (You can still get this information we'll return to

That contains thousands of files, you will rarely want to knowĪbout files that Mercurial is tracking, but that have notĬhanged. “ interesting” files-those that you have (forĮxample) modified, removed, or renamed. The reason for this is that by default, hg status only tells you about The files that you added before the commit will no longer be $ hg commit -m 'Added one file' $ hg status $ hg init add-example $ cd add-example $ echo a > myfile.txt $ hg status To tell Mercurial to track a file, use the hg add command. Status command will tell you which files Mercurial Mercurial does not work with files in your repository unless
