The macro is used to accept changes into a repository workspace. It will also download the changes to the sandbox if the operation was run from within the sandbox location. The changes to accept can be scoped in one of four ways: all changes in a workspace (default), all changes in a set of one of more components (using --components), all changes in one or more baselines (using --baseline), all changes in a set of one or more work items (using --workitems), or a specific set of changes (by specifying the change set aliases, or UUIDs).
The macro supports the SCM Macro Common Attributes, as well as, its own macro specific attributes. Click on the link for more information on the common attributes.
The following table describes the macro specific attributes for the macro:
| Macro Specific Attributes | ||
| Attribute | Description | Required |
| baselines | Indicates that the selectors refer to baselines and the specified baselines must be accepted. To specify a baseline, use its name, alias, or UUID in the list of selectors. | No* |
| changes | Indicates that the selectors refer to change sets and only the specified change sets must be accepted. To specify a change set, use its alias or UUID[@repo] in the list of selectors. | No* |
| components | Indicates that the selectors refer to components and all of the changes in the specified components must be accepted. To specify a component, use its name, alias, or UUID in the list of selector. | No* |
| source | Name of the source workspace or stream. | Yes |
| target | Name of the target workspace or stream. | Yes |
| workitems | Indicates that the selectors refer to work items and all the change sets must be accepted. To specify a work item, use its ID[@repo] in the list of selectors. | No* |
The macro accepts both 0 and 52 as successful return codes. The SCM subcommand return code 52 indicates that an accept succeeded, but there were no incoming changes, so the workspace remains unchanged.
This macro specifies the following options on the SCM command:
--baseline <selectors>
--changes <selectors>
--components <selectors>
--no-local-refresh
--directory <arg>
--source <arg>
--target <arg>
--workitems <selectors>
The following options can be added to the command using the additionalArgs element:
--accept-missing-changesets
--component-hierarchy
--flow-components
--in-place-markers
--json
--multiple-hierarchies
--n-way
--no-merge
--overwrite-uncommitted
--queue-merges
--report-delete-conflicts
--verbose
Additional selectors should be added with separate arg elements specified first in the additionalArgs element. For example:
< ... components="componentName0">
<additionalArgs>
<arg value="componentName1"/>
<arg value="componentName2"/>
<arg value="--verbose"/>
</additionalArgs>
</>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed Materials - Property of IBM
(c) Copyright IBM Corporation 2020. All Rights Reserved.
Note to U.S. Government Users Restricted Rights:
Use, duplication or disclosure restricted by GSA ADP Schedule
Contract with IBM Corp.
-->
<project
basedir="."
default="all"
name="Example"
xmlns:xt="antlib:com.ibm.team.build.extensions.toolkit">
<description>Example</description>
<!-- Load build extensions -->
<xt:loadBuildExtensions/>
<xt:getJarLocation property="jarPath"/>
<!-- Load common resources -->
<import>
<javaresource name="scripts/smpe/imports/$common.xml">
<classpath location="${jarPath}"/>
</javaresource>
</import>
<import>
<javaresource name="scripts/smpe/imports/$scmcmd.xml">
<classpath location="${jarPath}"/>
</javaresource>
</import>
<xt:setPassword password="${password}" property="passwd"/>
<property name="userId" value="ADMIN"/>
<property name="conf" value="/var/MacroTestingScm/.jazz-scm"/>
<property name="root" value="/var/MacroTestingScm/root"/>
<property name="scmd" value="/var/MacroTestingScm/zips/scmtools/eclipse"/>
<!-- - - - - - - - - - - - - - - - - - - *
* Example *
*- - - - - - - - - - - - - - - - - - - -->
<target name="main" description="main">
<!-- Scm -->
<ScmProperties
authenticate="Password"
repository="repositoryAddress"
password="passwd"
userid="userId"
cfg="conf"
dir="root"
scm="scmd"
/>
<!-- Load -->
<ScmLoadWorkspace workspace="${workspace}"/>
<!-- Accept -->
<ScmAccept source="${stream}" target="${workspace}"/>
</target>
<target depends="main" description="all" name="all"/>
</project>