Please note that this site is best viewed in a modern browser, like Safari, Chrome, or Firefox. Internet Explorer 8 and earlier versions are incapable of properly rendering many page elements.

S3 Update Mercurial Extension Icon

S3 Update Mercurial Extension

s3update.tgz
2011.07.16 • 16KB

The S3 Update extension for the Mercurial source control system adds the ability to update an Amazon S3 bucket with the contents of a revision and optionally purge untracked files found in the bucket.

Usage

hg s3update [options]

Enabling the Extension

To enable the extension, add one of the following to the hgrc file.

[extensions]
s3update=

or

[extensions]
s3update=/path/to/s3update

Parameters

The extension supports a number of options.

-r --rev VALUE		 a specific revision you would like to upload
			 (defaults to working directory)
-l --localpath VALUE	 the path of the repository subdirectory to upload
-b --bucket VALUE	 the name of the bucket to which to upload (required)
-m --remotepath VALUE	 the path of the bucket subdirectory to which to upload
-k --accesskey VALUE	 the S3 access key to use (required)
-s --accesssecret VALUE  the S3 access key secret to use (required)
-p --prune		 prune missing files from bucket
-z --gzip		 gzip text files before upload
-h --cleanhtml		 remove comments and unnecessary whitespace from HTML files before upload
-c --cleancss		 remove comments and unnecessary whitespace from CSS files before upload
-j --cleanjs		 remove comments and unnecessary whitespace from JavaScript files before upload
-a --acl VALUE		 the S3 canned ACL to use for the uploaded files

Configuration

The options can also be specified in the hgrc file for the project.

[s3update]
localpath = <path to local root>
bucket = <bucket name>
remotepath = <subpath to remote root>
accesskey = <s3 access key>
accesssecret = <s3 access key secret>
prune = True
gzip = True
cleanhtml = True
cleancss = True
cleanjs = True
acl = <acl>

Output

The output can be modified with the global mercurial verbose and debug options.

Normal

publishing to <bucket name>
<x> files uploaded, <y> extra items found, <z> files pruned

Verbose (--verbose)

publishing to <bucket name>
connecting to S3
downloading bucket list
getting changeset file list
comparing and uploading files
<x> files uploaded, <y> extra items found, <z> files pruned

Debug (--debug)

publishing to <bucket name>
using acl public-read
connecting to S3
downloading bucket list
found <a> items
getting changeset context
getting changeset file list
found <b> files
comparing and uploading files
  checking file path/to/file1.txt
    existing item found... calculating file digest... digest and file sizes match
  […]
<b> of <b> completed
<x> files uploaded, <y> extra items found, <z> files pruned

Version History

1.0.1 — 17 Jul 2011

  • Updated for Mercurial 1.9.
  • Requires Mercurial 1.9.

1.0 — 20 Feb 2011

  • Added support for gzipping text files.
  • Added support for rudimentary comment and whitespace removal in HTML, JavaScript, and CSS files.
  • Fixed an issue with running the script from a repository subdirectory.
  • Fixed an issue with publishing specific revisions.
  • Added warning when working directory has unsaved changes.

0.9 — Aug 2010

  • Initial release.

Future Enhancements

Features planned for future versions:

  • Store access key and secret in the keychain on Mac OS X.