Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-184

PerforceScmProvider.createClientspec should use the working dir's canonical path for the clientspec root

    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Activity

          People

            mperham Mike Perham
            jdidion John Didion
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: