• Advertisement
Sign in to follow this  

Mercurial commands - do I understand them right?

This topic is 1795 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm new to source-control systems in general, and I decided to go with Mercurial. Everything is already set up and working fine.

I have all my source code, and my data files, in the repository.

 

I use hg locally, so I'm not connecting to any server; I just have:

../path/to/my/project/

../path/to/my/project/.hg/

 

Would "../path/to/my/project/" be called the 'working directory'?

And "../path/to/my/project/.hg/" would be the "local repository"? (And in my case, the local repository is the only repository?)

 

I'm writing myself a cheat-sheet to print out and have next to my monitor, and I want to make sure I understand the commands and terminology and everything. Help me get my terminology and (more importantly) my mindset correct, please!

 

 

Some of the definitions I copy+pasted from other sites, so it doesn't necessarily mean I understand them - I might just think I do!
But most of them I used my own words to describe them, so if the wording is wrong, please correct my thinking.
 
So if you wouldn't mind, could you look over my descriptions of each command to make sure I'm not making a mistake?
 
mercurialcommands.png
 
I understand most of these commands also have additional options, but I don't want to be too overwhelmed with information all at once (I don't want to get feature-shocked), and will pick up new features overtime piece by piece - unless you notice I'm missing some super-important command, in-which-case please mention it!
 
Also, I couldn't get the hg diff command working.
Suppose I want to check the difference between revision 3's ./project/file.txt and revision 4's version - what's the right command?
" hg diff <filepath> -r 3:4 " isn't outputting anything, but I made a change to the file and commited.
" hg diff <filepath> -r3 -r4 " also didn't output anything.
 
I can't get " hg history <filepath> " to work either (it isn't outputting anything).
 
But a simple " hg diff <filepath> " works (after doing another change so that the local directory and the repository are different).
 
Is the tag 'tip' a special-case tag in Mercurial that refers to the most recent commited revision?
What is the tag 'head'?

 

Also, I'm thinking of using this scheme for my branches:

mercurialbranches.png

Would you recommend changing anything about that? Remember, I'm completely new to source revision control.

Share this post


Link to post
Share on other sites
Advertisement

The "Development" and "Stable" branches seem redundant: both represent the current state, merged from various feature branches where most development takes place, of somewhat complete new developments (as opposed to the  current state of what you are ready to release, the "Release" branch).

Both are equally suitable to serve as the starting point of new feature branches and as the proper source of consolidated new stuff you merge into "Release" branch.

If one "Development" branch isn't enough, probably you need more transient branches: "Feature X+Y" for merging with substantial rework, alternate development branches that differ by variations of a certain feature (for example, to evaluate comparatively the performance of different algorithms or the quality of competing external libraries), possibly throwaway experimental branches that aren't particularly associated with a feature.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement