分类: LINUX
2008-12-12 17:17:52
In a terminal, type:
sudo apt-get install mercurial
Also install KDiff3 for merge tool:
sudo apt-get install kdiff3
Note : each sudo
command may prompt you for your password.
Go to Mercurial download site, get the latest released version binary package and install (should be fairly straightforward).
Also install KDiff3 for merge tool, get it
Also install KDiff3 for merge tool, get it
An extra step for Windows is to install SSH. Get Putty and Plink at the . Then edit Mercurial.ini
in the Mercurial folder with this line :
[ui] ssh = c:\progra~1\putty\plink.exe -ssh -pw 'your password without quotes'
In a DOS prompt, run :
plink -ssh 'servername without quotes'It will ask you to accept the remote key, just say 'y'. Then you can enter your login, password and 'exit'.
For a more graphical interface to Mercurial, checkout .
There are several fundamental differences between CVS and Mercurial :
To get the code from the database, open a terminal (dos command prompt for Windows) and type the command :
hg clone ssh://login@host//path
To update your local database with the most recent code from the database, run the command :
hg pullfrom a directory of that database.
To do a CVS-like query update, you can run the command :
hg incomingto check what would change in case of a pull command.
That only updates your local database, but does not touch your local files. To do that, run :
hg update
To check the history of the database, run the command :
hg log
For a bit more graphical, there is an extension installed by default and you can run the command :
hg glog
You can also run a mini local server to browse the files, diffs and history with a web browser. To do that, run the command :
hg serveThe go to the address : in your favorite browser.
After you make some changes, you can check the status of your repository (what file has changed) :
hg statusThis will show the files that have been modified, added, deleted...
you can run commit :
hg commitNote that this commits all the files you changed.
This only records the changes you made in your local database.
When pulling changes, if some of your modified files have been changed remotely, Mercurial will detect the conflict and warn you. You will need to resolve the conflict, by running :
hg mergeThis is the place where it will run your external diff tool. When you are done, you can run
hg commit
and resume your work as usual.
hg status
. To add it to the database, you just need to run : hg add [filename]You will still need to push to the remote database.
hg status
, then run : hg remove [filename]You will still need to push to the remote database.
hg help [command]
In order to submit your changeset, it must first be rebased to the latest version of the mainline. To rebase use:
hg commit hg pull ssh://login@host//path
At this point hg will warn if multiple heads exist and or a merge is required. If a merge is required use:
hg merge
Next step is to ensure the database is pointing to the latest, which includes all your changes as well as the result of the rebase activity. To do this use:
hg update
At this point, the code is ready for submission. For now, you can be "nice" and do a build test. Later (Q1 09), it will be a mandatory step. In any case, now is the last chance to check the changeset is coherent and functional.
After testing the rebased changeset use:
hg bundle
Here the name of file should contain your username and something about the changeset. For example, ppanagas_bugfix90210, or ylin_atapi_direct_command, etc.
Send this file to your integrator. For MAPI_DB and KERNEL_DB, this is
Similar to the query update, before you create the bundle, you can check what is actually going out :
hg outgoing
There is also much more information, a tutorial and a good on the Mercurial website.
-- Main.matthieu - 02 Dec 2008
-- Main.ppanagas - 08 Dec 2008