Skip to content

Instantly share code, notes, and snippets.

@EwanDawson
Created April 17, 2012 16:28
Show Gist options
  • Save EwanDawson/2407315 to your computer and use it in GitHub Desktop.
Save EwanDawson/2407315 to your computer and use it in GitHub Desktop.
JavaHg test
@GrabResolver(name='javahg', root='https://oss.sonatype.org/content/repositories/snapshots/')
@Grab(group='com.aragost.javahg', module='javahg', version='0.3-SNAPSHOT')
import com.aragost.javahg.*
import com.aragost.javahg.commands.*
config = new RepositoryConfiguration()
config.hgrcPath = null // forces Mercurial to look in the usual places for .hgrc
rep = Repository.open(config, new File('.')) // assume the current directory is a repo
// Print the status of the repo
status = new StatusCommand(rep)
status.lines().each { println it }
// Tag the repo
tag = new TagCommand(rep)
tag.execute("MyTag")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment