AccuRev accuRev = repository.getAccuRev();
File basedir = fileSet.getBasedir();
AccuRevInfo info = accuRev.info( basedir );
if ( !info.isWorkSpace() )
{
throw new AccuRevException( "No workspace at " + basedir.getAbsolutePath() );
}
String startRevision = getStartRevision( repository, parameters, info );
ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
String updateTransactionId = null;
if ( scmVersion != null )
{
AccuRevVersion updateVersion = repository.getAccuRevVersion( scmVersion );
// Reparent if necessary
String newBasisStream = updateVersion.getBasisStream();
if ( newBasisStream != null
&& ( !( newBasisStream.equals( info.getWorkSpace() ) || newBasisStream.equals( info.getBasis() ) ) ) )
{
getLogger().info( "Reparenting " + info.getWorkSpace() + " to " + newBasisStream );
accuRev.chws( basedir, info.getWorkSpace(), newBasisStream );
}
if ( !updateVersion.isNow() )
{
updateTransactionId = updateVersion.getTimeSpec();
}
}
if ( updateTransactionId == null )
{
updateTransactionId = repository.getDepotTransactionId( info.getWorkSpace(), "now" );
}
String endRevision = repository.getRevision( info.getWorkSpace(), updateTransactionId );
List<File> updatedFiles = accuRev.update( basedir, updateTransactionId );
if ( updatedFiles != null )
{