Archive for category Mercurial

Searching mercurial revision by log

In mercurial you might be searching for specific revision and all you remember might be the comment you provided while committing. So in order to find it by the log message use


hg log --keyword "keyword goes here"

, , , , ,

Leave a Comment

Getting the difference between two branches in mercurial

Say you have branch named branch-one and the other being default
If you want to know what difference is there between the two, say what is in the branch-on but not in the default do:

hg log -r "'branch-one' - default"

There are also a couple of predicates that you can assign – just search with “hg revsets”
Yup Yup Yup

, ,

Leave a Comment

python headers are required to build mercurial error while installing

OK, I have been biking mercurial for a while and wanted to upgrade to the latest version
In the process of that, I got the error python headers are required to build mercurial
Here is the fix.
Just add

sudo apt-get install build-essential gcc python-dev

which it was missing.

For re-installation follow the steps listed on https://help.ubuntu.com/community/Mercurial

, , , , , , ,

3 Comments

Committing to different repository in mercurial hg

Say you are working on module somemodule which you cloned it from http://somemoude/live
Now you work your stuff and after creating and modifying some 82 files, you realized you should have cloned it from http://somemoude/rc.
So, basically you want to commit to other repository
patch files are the solution.
Here are step by step procedures

1. being on your current ‘the live’ repository do :

hg diff > mychanges.diff

. By the way you can achieve this though hg export

2. Clone a new module from http://somemoude/rc and name it different
3. move your rc version of module and apply the patch as

 hg import mychanges.diff

4. that is all then you can see all the changes being applied and hence you can commit it now

, , , , , , , , ,

Leave a Comment

outstanding uncommitted changes hg Mercurial Error

If you try to push the changes you have to the repository, you might come across outstanding uncommitted changes error in mercurial

It would happen when you have some changes pending in your local repository and you want to pull and rebase from the repository so that you can commit the changes you have

but, you might not want to push the changes even to your local repo.

here is the fix for it:
lets say the module you have is testHG which you cloned it from http://sometestHg/hg
1. Do hg clone testHG testHG_temp – create the clone of the current module, not copy!!
2. cd testHG_temp – move to your new clone
3. hg pull –rebase http://sometestHg/hg – note you have to actually go to the main repo
4. hg push http://sometestHg/hg

Then you can delete the temp directory you created
Happy mercuriying!!

, , , , , , ,

Leave a Comment

Follow

Get every new post delivered to your Inbox.