views:

322

answers:

1

I use Netbeans for development and have been doing my Mercurial operations on the command line even though Netbeans has a Mercurial plugin to add various Mercurial commands as GUI options.

One of the things I always do when I add or delete a file is run

hg addremove

But the Netbeans Mercurial plugin doesn't offer this as an option. The only operations it offers are:

Status
Diff
Commit
----
Resolve Conflicts
----
Show History
----
Revert
----
Mercurial Settings

So my question is whether it is necessary to run

hg addremove

I just tried deleting a file and then did

hg commit -m

and after I did a

hg status

everything seemed to be good - no output. So it seemed to delete the file without needing to run the addremove command.

I'm a little confused whether this plugin covers most of the features I will need or whether I should stick with the command line interface.

+1  A: 

As long as you do everything through the NetBeans GUI, you won't need addremove.

When you add a new file, Netbeans automatically calls 'hg add filename". Likewise, deleting a file calls "hg rm" and renaming a file calls "hg move".

The only time you need addremove is if you add, delete, or move files outsize of NetBeans.

Be very careful editing files in the nbproject directory. I had the experience of editing project.properties and then making a change in NetBeans that caused it to regenerate the file. The mercurial command it issued was:

hg move nbproject/project.properties nbproject/project.properties~

So, the result was:

hg stat
A nbproject/project.properties~
R nbproject/project.properties

Thank goodness for "hg revert".

Devon_C_Miller
"When you add a new file, Netbeans automatically calls 'hg add filename". Likewise, deleting a file calls "hg rm" and renaming a file calls "hg move"." -> Great info. Thanks.
A small correction: though deleting a file from the GUI will call 'hg rm' immediately, and similarly for move/rename, adding a file in the GUI will not call 'hg add' until you actually commit. This only matters if you do some things in the IDE but then commit from the command line; in this case you will need to manually 'hg add' the files you created.
Jesse Glick