[F004] Add

This functionality aims to surround : hg add and to adapt it for <ant> tags.

Shell command

hg add [OPTION]... [FILE]...

add the specified files on the next commit

    Schedule files to be version controlled and added to the repository.

    The files will be added to the repository at the next commit. To undo an
    add before that, see hg forget.

    If no names are given, add all files to the repository.


 -I --include  include names matching the given patterns
 -X --exclude  exclude names matching the given patterns
 -n --dry-run  do not perform actions, just print output

use "hg -v help add" to show global options


Attribute Description Value Required
cmd hg command add yes
dir directory to add yes
dry-run do not perform actions, just print output true/false, yes/no, on/off no
Nested element Description Required
dirset resource collections no
arg command line argument value no


<project name="hg-add" default="add" basedir=".">

  <taskdef resource="net/sourceforge/ant4hg/taskdefs/antlib.xml" />

  <property name="user" value="myname"/>
  <!-- patterns -->
  <patternset id="cpp.pattern">
    <include name="**/*.cpp" />

  <target name="add">
    <hg cmd="add" dir="." pattern="cpp.pattern" />

  <target name="add2">
    <hg cmd="add" dir=".">
      <dirset dir="src">
        <include name="**/*.java"/>
        <exclude name="**/*.bak"/>