[
https://issues.apache.org/jira/browse/SCM-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17960417#comment-17960417
]
ASF GitHub Bot commented on SCM-184:
------------------------------------
jira-importer opened a new issue, #398:
URL: https://github.com/apache/maven-scm/issues/398
**[John
Didion](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jdidion)**
opened
**[SCM-184](https://issues.apache.org/jira/browse/SCM-184?redirect=false)** and
commented
createClientspec should look like this:
```
public static String createClientspec( PerforceScmProviderRepository
repo, String specname, File workDir )
{
String clientspecName = getClientspecName( repo, workDir );
String userName = getUsername( repo );
String rootDir = null;
try {
rootDir = workDir.getCanonicalPath();
} catch (IOException ex) {
//getLogger().error("Error getting canonical path for working
directory: " + workDir, ex);
rootDir = workDir.getAbsolutePath();
}
StringBuffer buf = new StringBuffer();
buf.append( "Client: " ).append( clientspecName ).append( NEWLINE );
buf.append( "Root: " ).append( rootDir ).append( NEWLINE );
buf.append( "Owner: " ).append( userName ).append( NEWLINE );
buf.append( "View:" ).append( NEWLINE );
buf.append( "\t" ).append( PerforceScmProvider.getCanonicalRepoPath(
repo.getPath() ) );
buf.append( " //" ).append( clientspecName ).append( "/..."
).append( NEWLINE );
buf.append( "Description:" ).append( NEWLINE );
buf.append( "\t" ).append( "Created by maven-scm-provider-perforce"
).append( NEWLINE );
return buf.toString();
}
```
Otherwise, when used with continuum, the changelog command will never work.
The continuum working directory always looks like
CONTINUUM_HOME/bin/win32/../../apps/depot/69 when creating the clientspec, and
perforce seems not to know how to deal with non-canonical paths, so perforce
always just spits out an error message and returns no changes. This sucks
because then build complete notifications never get sent.
---
**Affects:** 1.0-beta-4
> PerforceScmProvider.createClientspec should use the working dir's canonical
> path for the clientspec root
> --------------------------------------------------------------------------------------------------------
>
> Key: SCM-184
> URL: https://issues.apache.org/jira/browse/SCM-184
> Project: Maven SCM (Moved to GitHub Issues)
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.0-beta-4
> Reporter: John Didion
> Assignee: Mike Perham
> Priority: Major
> Fix For: 1.0-beta-4
>
>
> createClientspec should look like this:
> {noformat}
> public static String createClientspec( PerforceScmProviderRepository
> repo, String specname, File workDir )
> {
> String clientspecName = getClientspecName( repo, workDir );
> String userName = getUsername( repo );
> String rootDir = null;
> try {
> rootDir = workDir.getCanonicalPath();
> } catch (IOException ex) {
> //getLogger().error("Error getting canonical path for working
> directory: " + workDir, ex);
> rootDir = workDir.getAbsolutePath();
> }
> StringBuffer buf = new StringBuffer();
> buf.append( "Client: " ).append( clientspecName ).append( NEWLINE );
> buf.append( "Root: " ).append( rootDir ).append( NEWLINE );
> buf.append( "Owner: " ).append( userName ).append( NEWLINE );
> buf.append( "View:" ).append( NEWLINE );
> buf.append( "\t" ).append( PerforceScmProvider.getCanonicalRepoPath(
> repo.getPath() ) );
> buf.append( " //" ).append( clientspecName ).append( "/..." ).append(
> NEWLINE );
> buf.append( "Description:" ).append( NEWLINE );
> buf.append( "\t" ).append( "Created by maven-scm-provider-perforce"
> ).append( NEWLINE );
> return buf.toString();
> }
> {noformat}
> Otherwise, when used with continuum, the changelog command will never work.
> The continuum working directory always looks like
> CONTINUUM_HOME/bin/win32/../../apps/depot/69 when creating the clientspec,
> and perforce seems not to know how to deal with non-canonical paths, so
> perforce always just spits out an error message and returns no changes. This
> sucks because then build complete notifications never get sent.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)