Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
Mercurial Version ControlAdrian Singer, 09-02-2009 |
Mercurial (also called HG) is a cross-platform, super-fast, distributed revision control system for software developers.
Unlike other version control tools such as CVS, SVN, Preforce etc., Mercurial is a distributed system, where every node can act as both a client and server.
We've tested a lot of competing revision control systems, before Mercurial won us over.
The advantages Mercurial brings to the table include:
* Allows users to work on a local copy of the files, even when not connected to a network
* Most operation are faster since no network is involved
* Allows private work, so you can use your revision control system even for early drafts you don't want to publish
* Avoids relying on a single physical machine. A server disk crash is a non-event with distributed revision control
* Allows participation in projects without requiring permissions from project authorities, instead of requiring "committer" status
Graphical User Interface
Mercurial comes with great desktop integration for Windows and Mac, using a tool called Tortoise. Once installed, it adds a right-click context-menu, allowing one-click commit, file diff, sync, directly from the file explorer.
Tortoise includes a green icon next to all files that are up-to-date and an orange icon next to files that have been updated and need to be uploaded.

How to install Mercurial
An all-in-one Mercurial+Tortoise installer is available here
Once installed, Mercurial will add a right-click context-menu, as shown in the image above.
Before you move forward, it is important that you setup a Username, so that all Commits you upload, include your name.
Right click and select 'Global Options' from HG menu. Then enter your full name under Username

Next - click on the 'Sync' tab and select Update as the 'after pull operation'

Connecting to a live repository
Create a new folder on your machine where you'd like to save all source files, right click and select 'Create Repository Here' from Mercurial's menu

This will create two files under the current directory:
.hg subfolder
.hgignore text file
To avoid any conflicts, go ahead and delete the .hgignore text file.
Now that the repository is created, we can download all files from the server. Right click again and select 'Synchronize' from the menu.
This popup window will open:

Enter the live repository url and click the 'Pull' button to download all source files from the live repository.
Note: You can repeat this process of synchronizing with the live server, whenever you'd like to download updates from the server.
The first time you synchornize, it's going to take a while. But subsequent pulls will be very quick.
Updating Files
Step 1: Open the local copy of the file in your favorite editor, make changes and hit Save.
Mercurial detects the change and automatically updates the file icon to orange.
Step 2: Once you're done making changes, right-click and select HG Commit.
Enter a comment describing the changes you've just implemented. For example:
"Project 384283 - Added opt-in form on instant pay increase"
Good comments are the basis of a solid version control system. Your comments help other developers understand the nature of your changes, as they download them to their local repositories.
Step 3: Unlike a centralized cvs, the 'Commit' operation is a local one. Once changes are committed to your local repository, Right click and select 'Synchronize'. Enter the live repository url and click the 'Push' button. This takes care of uploading your changes to the server.
Adding new files to the project
In order to add a new file, you have to take one additional step -
Highlight the new files, right click and select 'Add Files'

Then, follow the steps listed under "Updating Files", committing changes and synchronizing with the server.
Unlike other version control tools such as CVS, SVN, Preforce etc., Mercurial is a distributed system, where every node can act as both a client and server.
We've tested a lot of competing revision control systems, before Mercurial won us over.
The advantages Mercurial brings to the table include:
* Allows users to work on a local copy of the files, even when not connected to a network
* Most operation are faster since no network is involved
* Allows private work, so you can use your revision control system even for early drafts you don't want to publish
* Avoids relying on a single physical machine. A server disk crash is a non-event with distributed revision control
* Allows participation in projects without requiring permissions from project authorities, instead of requiring "committer" status
Graphical User Interface
Mercurial comes with great desktop integration for Windows and Mac, using a tool called Tortoise. Once installed, it adds a right-click context-menu, allowing one-click commit, file diff, sync, directly from the file explorer.
Tortoise includes a green icon next to all files that are up-to-date and an orange icon next to files that have been updated and need to be uploaded.

How to install Mercurial
An all-in-one Mercurial+Tortoise installer is available here
Once installed, Mercurial will add a right-click context-menu, as shown in the image above.
Before you move forward, it is important that you setup a Username, so that all Commits you upload, include your name.
Right click and select 'Global Options' from HG menu. Then enter your full name under Username

Next - click on the 'Sync' tab and select Update as the 'after pull operation'

Connecting to a live repository
Create a new folder on your machine where you'd like to save all source files, right click and select 'Create Repository Here' from Mercurial's menu

This will create two files under the current directory:
.hg subfolder
.hgignore text file
To avoid any conflicts, go ahead and delete the .hgignore text file.
Now that the repository is created, we can download all files from the server. Right click again and select 'Synchronize' from the menu.
This popup window will open:

Enter the live repository url and click the 'Pull' button to download all source files from the live repository.
Note: You can repeat this process of synchronizing with the live server, whenever you'd like to download updates from the server.
The first time you synchornize, it's going to take a while. But subsequent pulls will be very quick.
Updating Files
Step 1: Open the local copy of the file in your favorite editor, make changes and hit Save.
Mercurial detects the change and automatically updates the file icon to orange.
Step 2: Once you're done making changes, right-click and select HG Commit.
Enter a comment describing the changes you've just implemented. For example:
"Project 384283 - Added opt-in form on instant pay increase"
Good comments are the basis of a solid version control system. Your comments help other developers understand the nature of your changes, as they download them to their local repositories.
Step 3: Unlike a centralized cvs, the 'Commit' operation is a local one. Once changes are committed to your local repository, Right click and select 'Synchronize'. Enter the live repository url and click the 'Push' button. This takes care of uploading your changes to the server.
Adding new files to the project
In order to add a new file, you have to take one additional step -
Highlight the new files, right click and select 'Add Files'

Then, follow the steps listed under "Updating Files", committing changes and synchronizing with the server.
![]() |
Mike Peters, 09-03-2009 |
If you're installing Mercurial on FreeBSD, the recent version of Mercurial for FreeBSD is available here:
http://mercurial.selenic.com/downloads/
But on FreeBSD you can simply issue:
http://mercurial.selenic.com/downloads/
But on FreeBSD you can simply issue:
cd /usr/ports/devel/mercurial
make all
make install
make all
make install
![]() |
Adrian Singer, 09-03-2009 |
A good .hgignore file, that will prevent storing videos and mp3 files in the code repository:
.hgignore:
.hgignore:
syntax: glob
*.mov
*.mp3
*.wav
*.tar
*.tar.gz
*.swf
*.ace
*.zip
*.core
backup/*
tmp/*
temp/*
*.a
*.so
a
*.out
*.log
*.bin
*.flv
*.wmv
*.mpeg
*.mov
*.mp3
*.wav
*.tar
*.tar.gz
*.swf
*.ace
*.zip
*.core
backup/*
tmp/*
temp/*
*.a
*.so
a
*.out
*.log
*.bin
*.flv
*.wmv
*.mpeg
![]() |
Mike Peters, 11-19-2009 |
All of HG's configuration parameters are stored under a file named: hgrc
This file is under the .hg folder
Your first step is to select "Create Repository here". This will create a new .hg subfolder under the current directory.
Go to that subfolder and create a new text file named: hgrc
Save the connection parameters into that file, for example:
Once done, right click and select Sync. Then click the Pull button to download all sources.
This file is under the .hg folder
Your first step is to select "Create Repository here". This will create a new .hg subfolder under the current directory.
Go to that subfolder and create a new text file named: hgrc
Save the connection parameters into that file, for example:
[paths]
default = http://username:password@domain.com/
[tortoisehg]
postpull = update
default = http://username:password@domain.com/
[tortoisehg]
postpull = update
Once done, right click and select Sync. Then click the Pull button to download all sources.
![]() |
Mike Peters, 02-14-2010 |
If you're trying to install Mercurial HG on FreeBSD7 and keep getting this error:
You need to install compat6x and reinstall Python26:
Quote:
|
/libexec/ld-elf.so.1: /usr/lib/libpthread.so.2: version LIBTHREAD_1_0 required by python not found |
You need to install compat6x and reinstall Python26:
cd /usr/ports/misc/compat6x
make all
make install
cd /usr/ports/lang/python26
make all
make deinstall
make install
make all
make install
cd /usr/ports/lang/python26
make all
make deinstall
make install
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments


