ANT4HG is an ANT task for HG ( mercurial ) , a distributed source control management system.
You can use ant4hg :
Latest version is ant4hg V0.07. It has been released with ant 1.8.0 and hg 1.5.1.
Source code and binaries are available on the SourceForge download page .
To implement missing commands, please read this cookbook.
For example :
$ hg help summary
hg summary [--remote]
aliases: sum
summarize working directory state
This generates a brief summary of the working directory state, including
parents, branch, commit status, and available updates.
With the --remote option, this will check the default paths for incoming
and outgoing changes. This can be time-consuming.
options:
--remote check for push and pull
net/sourceforge/ant4hg/taskdefs/SummaryTask.java
Create new class
package net.sourceforge.ant4hg.taskdefs;
public class SummaryTask extends HgTask {
public SummaryTask(HgTask task) {
super(task);
}
}
net/sourceforge/ant4hg/taskdefs/HgTask.java
Write options
protected String remote;
public void setRemote(String remote) {
this.remote = remote;
}
net/sourceforge/ant4hg/taskdefs/SummaryTask.java
Copy options
public SummaryTask(HgTask task) {
super(task);
// copy options
this.remote = task.remote;
}
net/sourceforge/ant4hg/taskdefs/SummaryTask.java
Override : initCommandLine
@Override
public void initCommandLine() {
super.initCommandLine();
// init command line
if (isTrue(remote)) {
super.cmdl.createArgument().setValue("--remote");
}
// OR if (isSet(remote) && remote.equals("true") ) ...
}
}
<hg cmd="summary" dir="." remote="true" />
<au:assertLogContains text="..." level="info" />
ANT4HG aims to support all mercurial
functionalities.
Current functionalities are described in the specification
document.
[2009-05-10] mercurial ant task V0.07 is available for download .
Added features : f11-export
[2009-11-29] mercurial ant task V0.06 released.
Updated features : f008-clone, f009-pull, f010-push
[2009-09-24] mercurial ant task V0.05 released.
New features : f008-clone, f009-pull, f010-push
(added to f001-init, f002-status, f003-log, f004-add, f005-remove,
f006-commit, f007-update)
[2009-07-07] mercurial ant task V0.04 released.
[2009-05-27] mercurial ant task V0.03 released.
[2009-04-15] mercurial ant task V0.02 released.
[2009-04-08] specifications : first draft