Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I write all (well, most) of my programs in an IDE, mostly it's netbeans.

Should I just use Mercurial through the IDE, or is it better if I used the CLI instead? and why?

share|improve this question
2  
Why would you ever step outside the IDE to do something from the CLI? –  S.Lott Mar 17 '11 at 12:51
5  
Because the IDE might not provide the full functionality of an external program, in this case, hg or git –  Mahmoud Hossam Mar 17 '11 at 12:53
4  
Looks like you answered your own question... –  Laurent Pireyn Mar 17 '11 at 13:08
    
I find being able to use a CLI very helpful, if nothing else it is much easier to script a CLI –  Zachary K Mar 17 '11 at 14:05

7 Answers 7

up vote 2 down vote accepted

I use Netbeans and Mercurial daily.

The integration of Mercurial in Netbeans is good, but I find TortoiseHg to be much clearer than what Netbeans can show. So, I use both tools :

In TortoiseHg, I pull, push, commit, merge, update, tag, rollback, backout, import/export, revert, edit .hgignore and hgrc files, watch the history graph, guess copy/renames, and bisect.

In Netbeans, I benefit from the interactive diff (green/blue/red marks at the left of the editor), I also benefit from the fact that the refactorings done in Netbeans are recorded in Mercurial. I revert files or parts of a file. I sometimes watch the diff between 2 revisions, side by side. And I sometimes show the annotations (blame).

I won't argue why I do some actions in one tool or another. I won't argue the use of the CLI versus a GUI. These are personal tastes. What I wanted to emphasis is that nothing prevents you from using multiple tools to work with Mercurial. Every actions you do in either tools (or with the CLI) will be seen by the others. Ok, sometimes I have to tell Netbeans to refresh by asking a hg status, but this is not critical.

Note that this is not true for Subversion+Netbeans. When I was using Subversion, I had some conflicts between Netbeans and external tools when working on the same local copy.

share|improve this answer
    
I'll choose this answer because it's the most relevant to my case, I use mercurial and netbeans as well, thank you. –  Mahmoud Hossam Mar 17 '11 at 19:20

Use your IDE if it has pretty good support.

Look at it this way - the CLI gives you the same access to the raw data, but the IDE/GUI can add a lot of convenient ways to organize and view, and automatically manage (moving/renaming) that data. In mine, for example (IntelliJ IDEA):

  • Automatically add files
  • Browse all history
  • Browse file history
  • Compare with other revision
  • Compare with branch
  • Right click to see line-by-line history (annotation/blame)
  • Click a line change, then see all paths affected in that transaction (helpful to see why a change was made)
  • Performing a seamless Move/Rename when renaming classes, or other refactoring which affects the file tree.

To double-check myself before I make a commit (I'm using Subversion but if you are using a DVCS, it would be the same before you push to the central repository), the commit dialog provides a convenient diff button that I can just cycle through all the changes I made one more time, to make sure I didn't make any dumb mistakes.


On the other hand, if I ever have to move a repository location, create a lot of folders, or pull some unversioned files from one working copy to another, I often use the command line, as the IDE VCS can get in the way by asking me too often if I want to "Add" the file, or performing a VCS Move/Copy when I didn't actually want it to.

share|improve this answer

I think that depends much on your personal work flow. If the IDE gives you enough functionality to your VCS why should you switch to CLI. If this is not the case, what's so bad about the CLI at all.

I personally use eclipse and mercurial. But I have no plugin in eclipse for hg. Since I always have at least one shell open it is perfectly fine with my work flow to hack some command into the shell from time to time.

For me this works very well.

share|improve this answer

Depends on your needs and proficiency with the VCS, and obviously your own preference for either a GUI or shell tool. I generally find IDE VCS tools painful, and too basic to do most of the things I want to do. And unless we come up with some more flexible GUI widgets, it looks like GUIs will forever be playing catch-up with the much more powerful shell tools available.

share|improve this answer
    
Some GUI tools are quite complete, and are better suited for some tasks : display the history graph (and interact with it visually), and doing partial commits (by files or by chunks of file). –  barjak Mar 17 '11 at 14:10

If you have a plugin that works well, then, why would you not use it? If you can browse changes easily without switching to a different environment, that is a big productivity boost.

If you do not have a plugin, or it does not give you all the functionality you need, then, by all means, use the CLI.

I use ankhSVN with VisualStudio, and it works great.

share|improve this answer

Using the IDE is easier because it's just a few clicks away from what you're coding. Sometimes it's better to use a command line because you have more flexibility and control.

There is no reason to have to choose. They should all work together out of the box. I use Netbeans, Tortoise and command line (in linux just Netbeans and shell).

share|improve this answer

I use my IDE to code. (Visual Studio for example)

I use another tool to manage my changesets. (TortsoieHg)

I use another tool to manage tasks/bugs/things to do. (TRAC/Redmine/EtC.)

I don't mix them because they help me switch between different mindsets.

When I code, I focus on writing solutions to problems. I design, think, write code etc. When I think I'm done, I go out of the IDE.

Then I'm in a different way of mind : I review my code, using the external tool. I first boot it to check what changes I just did finish, then I read it all, see if it looks right. Then I commit (or not).

After that, I take a look at other tasks to do, and often it's again in another tool. Once the next task is decided and I need to design and write code, I get back to the IDE.

Without this separation, I would only focus on one of those things : code, commit something, validate/check tasks. One of those would be done correctly but not the others. The interruption when switching tools help switch context of the mind and change the immediate objectives.

But I'm not sure if it works like that for others.

I often tried to have everything in my IDE, but each time I felt I was doing too much things in the same time and not doing them very well. It's like having web pages in the same screen where you have the IDE open, you can't concentrate on both.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.