Skip to content
millerjv edited this page Nov 7, 2012 · 22 revisions

jqplot hg git bridge

Purpose

This repository is part of a bridge between hg and git. jqplot uses Mercurial while the Slicer4 SuperBuild process supports git and not hg. This repository is a clone of the Mercurial repository forked from the master jqplot repository on BitBucket. This repository supports the Slicer4 build process and allow us to develop patches. Patches will be applied directly to the github version, then bridged back to Mercurial, pushed back to BitBucket, and offered back to the jqplot developers.

This strategy was chosen because

  1. SuperBuild is complicated enough without introducing a forth revision control system (svn, git, cvs).
  2. Slicer will utilize these patches to jqplot even if jqplot decides not to accept them
  3. Slicer's development timeline is asynchronous with jqplot's development timeline
  4. Patches are expected to be few and far between, so the manual bridging from git back to hg is a rare event

the Hg-Git mercurial plugin

The Hg-Git mercurial plugin allows for Mercurial to clone git repositories. If you want to be able to build new jqplot tarballs of the Slicer4 branch, then you will need Mercurial and the Hg-Git mercurial plugin.

Repositories

This bridge of hg and git requires a checkout to act as the intermediary between hg and git. This intermediary repository uses hg-git. See the directions there on how to configure hg to have a git bridge.

Instructions to synchronize the hg and git bridge repository.

Location of bridge repository

$ cd ~/Projects/jqplot-hg-git-bridge/jqplot

To pull updates to jqplot from bitbucket

$ hg pull

To apply updates to the jqplot working directory

$ hg update tip

To push updates to github

$ hg push git+ssh://[email protected]/Slicer/jqplot.git

To pull updates from github

$ hg pull git+ssh://[email protected]/Slicer/jqplot.git

Branches, no I mean bookmarks

On the git repository for jqplot, we use git branches to manage development and release branches. The git branches are mapped to bookmarks on the mercurial repository.

The initial branch is named 1.0.4-Slicer4. This indicates that the branch is off of the 1.0.4 release of jqplot.

Building the tarballs

Building the tarballs for jqplot requires Mercurial to get the version and revision numbers. (Note that Mercurial revision numbers are local to the checkout so they should not be used as a reference across checkouts.)

With hg-git installed, you can use hg to checkout Slicer's git version of the repository.

$ hg clone git+ssh://[email protected]/Slicer/jqplot.git
$ cd jqplot
$ hg update 1.0.4-Slicer4  # switch to the Slicer4 bookmark/branch
$ ant compress

The file dist/jquery-jqplot-1.0.4rXXXX.tar.gz can be uploaded to https://github.com/Slicer/jqPlot/downloads

Be careful when creating and uploading tarballs. Tarballs are named by the build script (build.xml) based on the jqplot version and jqplot revision. Revision numbers in hg are local to the repository. If multiple people generate tarballs, then multiple points in the history from different machines may have the same revision number and may generate tarballs with the same name. For now, this can be managed by being careful and perhaps manually modifying the name of the tarball when a conflict occurs. Ultimately, it would be better if the tarballs were named based on the hashes. We may do this on our branch.

Slicer4/SuperBuild/External_jqPlot.cmake then needs to reflect the tarball name and MD5.

Clone this wiki locally