tags:

views:

32

answers:

3

If I do 'hg status' and see the following:

R flash/AC_OETags.js

it seems to mean that there is no file there, but there has been one at some point that has been removed.

How do I 'commit' this change so it stops showing up when I do 'hg status'?

==UPDATE==

The answer seems to be to commit the file. Actually, there are ~100 files with status R because I removed an entire directory tree. Anyone know how to commit all files in a directory tree in one go?

I don't want to do just hg commit, because there are other changes too.

A: 

The “R” means “Removed” so the next time we commit in Mercurial this file will be removed. (The history of the file will remain in the repository, so of course we can always get it back).

therefore run your hg commit command and all will be well

Thanks to hginit.com for that titbit - its my Mercurial bible

PaulStack
thanks. I don't just want to run 'hg commit' though because I have masses of other uncommitted files. do you know how i could just commit everything in the /flash directory, say?
AP257
if you have access to your local machine to install files then install Tortoise Hg and then commit that 1 change on its own *shakes head, I cant believe I just said that* lol
PaulStack
+1  A: 

You can commit just that file:

hg commit flash/AC_OETags.js

however having "masses of other uncommitted files" is terrible process. You need to come up with a workflow that lets you commit frequently.

Ry4an
Too true! Is there a way to commit 'all files in a directory', do you know?
AP257
The reason there are loads of uncommitted removed files is that I removed an entire directory tree. Do I then have to commit each file individually?!
AP257
Sure just do `hg commit directory` to commit the files in directory and below. Or use the `-I` and `-X` patterns to include/exclude as you'd like. With patterns as defined here: http://www.selenic.com/mercurial/hg.1.html#file-name-patterns
Ry4an
A: 

You can use the repository explorer from TortoiseHg to easily manage the files you want to include in a commit.

Also, removing a directory probably warrants a changeset in itself. You should get into the habit of committing more often (one concept, one commit... and it's local anyway). Furthermore, as long as you haven't pushed your changes to anyone (or anyone pulled from you) you could still use hg rebase --collapse to regroup some changesets if you think you have separated too much (this is a more advanced feature that I suggest you try on a test repository first as you could break things if you're not careful)

Eric-Karl