Home > programming, Techie > Production Code Deployment with Mercurial Version Control

Production Code Deployment with Mercurial Version Control

I recently switched to Mercurial source control and it’s proving to be a lot more fun to work with than Subversion. However there is one SVN feature that I have been missing dearly: The ability to export deployment code. SVN has an export command that I would use to generate a copy of project source files free from all the source control utility folders.

Up until recently, I had not figured out how to do this in Mercurial. I had to manually remove the .hg folder in order to move project files to production. That was until I came across this gem. Mercurial has an Archive command. It essentially does the same thing as the SVN Export command. In order to archive in TortoiseHg (Windows):

Export Prodcution Code

Export Prodcution Code

  1. Right-click the source code project folder and select Hg Repository Explorer.
  2. In the Repository Explorer, right-click on the default (tip) revision point and select Archive.
  3. On the Archive dialog:
  • Select the Archive revision you want to export
  • Supply the destination path
  • Pick Directory of files as the Archive type.
  • Click Archive.

You now have a copy of your source files that does not contain source control infrastructure.

Advertisements
  1. Al Alamein
    March 18, 2011 at 13:37

    Yes, but SVN ‘export’ works with remote repository whereas Hg ‘archive’ – not. And deploying local repository is not very useful…

    • kalengi
      March 18, 2011 at 22:35

      Hi Alamein,

      Yeah, there are things I do miss about SVN and that’s one of them 😦 I guess one tool can’t carry all features 🙂

      Thanks for pointing that out!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: