/** * Copyright (c) 2010 Perforce Software. All rights reserved. */ package com.perforce.maven.scm.provider.p4.command.info; import java.util.ArrayList; import java.util.List; import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.command.info.InfoItem; import org.apache.maven.scm.command.info.InfoScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import com.perforce.maven.scm.provider.p4.command.P4Command; import com.perforce.maven.scm.provider.p4.util.P4Utils; import com.perforce.p4java.client.IClient; import com.perforce.p4java.core.IChangelistSummary; /** * The class uses the Perforce edit command to open existing files for edit. */ public class P4InfoCommand extends AbstractCommand implements P4Command { /** The Constant command. */ public static final String command = "Perforce info command"; private IClient client; public void setClient( IClient client ) { this.client = client; } protected InfoScmResult executeCommand( ScmProviderRepository repo, ScmFileSet files, CommandParameters params ) throws ScmException { List<InfoItem> infoItems = new ArrayList<InfoItem>(); InfoItem infoItem = new InfoItem(); ScmVersion scmVersion = null; if ( params != null ) { scmVersion = params.getScmVersion( CommandParameter.SCM_VERSION, null ); } IChangelistSummary cl = P4Utils.getLatestChangelist( client, files.getBasedir(), scmVersion ); infoItem.setRevision( Long.toString( cl.getId() ) ); infoItem.setLastChangedRevision( Long.toString( cl.getId() ) ); infoItem.setLastChangedAuthor( cl.getUsername() ); infoItem.setLastChangedDate( cl.getDate().toString() ); infoItems.add( infoItem ); InfoScmResult result = new InfoScmResult( command, infoItems ); return result; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 12267 | dantran | date pattern correction, so that it can be used as is | ||
#5 | 12264 | dantran | Changelog and Info command should hornor user date pattern | ||
#4 | 11533 | dantran | Gracefully fault back latest client revision to latest repo revision when client have not sync with server yet | ||
#3 | 11507 | dantran |
- Tagging should use revision of last sync - Info pickup both latest from server and latest from client workspace last sync |
||
#2 | 11424 | dantran |
- P4Java logs are no under debug mode to reduce verbosity. To enable, pass in -X into mvn command - Info command now supports tag - Add p4java into export extension - Use BSD for license name - Update doc |
||
#1 | 11392 | dantran |
Add missing provider info implementation. This is needed by buildnumber-maven-plugin to create build number using latest changelist |