maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1094193 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src: main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ test/resources/cl...
Date Sun, 17 Apr 2011 20:28:59 GMT
Author: olamy
Date: Sun Apr 17 20:28:59 2011
New Revision: 1094193

URL: http://svn.apache.org/viewvc?rev=1094193&view=rev
Log:
[SCM-619] Add revision number in changelog clearcase command.
Submitted by Jeremie Lagarde

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcaselog.txt

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java?rev=1094193&r1=1094192&r2=1094193&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java
Sun Apr 17 20:28:59 2011
@@ -126,6 +126,7 @@ public class ClearCaseChangeLogCommand
         format.append( "DATE:%Nd\\n" );
         format.append( "COMM:%-12.12o - %o - %c - Activity: %[activity]p\\n" );
         format.append( "USER:%" + userFormat + "u\\n" );
+        format.append( "REVI:%Ln\\n" );
 
         command.createArg().setValue( "-fmt" );
         command.createArg().setValue( format.toString() );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java?rev=1094193&r1=1094192&r2=1094193&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java
Sun Apr 17 20:28:59 2011
@@ -49,6 +49,8 @@ public class ClearCaseChangeLogConsumer
 
     private static final String COMMENT_TAG = "COMM:";
 
+    private static final String REVISION_TAG = "REVI:";
+    
     private List<ChangeSet> entries = new ArrayList<ChangeSet>();
 
     // state machine constants for reading clearcase lshistory command output
@@ -69,6 +71,11 @@ public class ClearCaseChangeLogConsumer
     private static final int GET_COMMENT = 3;
 
     /**
+     * expecting revision
+     */
+    private static final int GET_REVISION = 4;
+
+    /**
      * current status of the parser
      */
     private int status = GET_FILE;
@@ -123,6 +130,9 @@ public class ClearCaseChangeLogConsumer
             case GET_COMMENT:
                 processGetCommentAndUser( line );
                 break;
+            case GET_REVISION:
+                processGetRevision( line );
+                break;
             default:
                 if ( getLogger().isWarnEnabled() )
                 {
@@ -188,7 +198,7 @@ public class ClearCaseChangeLogConsumer
 
             entries.add( getCurrentChange() );
 
-            setStatus( GET_FILE );
+            setStatus( GET_REVISION );
         }
         else
         {
@@ -196,6 +206,21 @@ public class ClearCaseChangeLogConsumer
             getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n"
);
         }
     }
+    
+    /**
+     * Process the current input line in the Get Revision.
+     *
+     * @param line a line of text from the clearcase log output
+     */
+    private void processGetRevision( String line )
+    {
+        if ( line.startsWith( REVISION_TAG ) )
+        {
+            getCurrentChange().setRevision( line.substring( REVISION_TAG.length() ) );
+
+            setStatus( GET_FILE );
+        }
+    }
 
     /**
      * Getter for property currentFile.

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.java?rev=1094193&r1=1094192&r2=1094193&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.java
Sun Apr 17 20:28:59 2011
@@ -44,7 +44,7 @@ public class ClearCaseChangeLogCommandTe
         Date endDate = null;
 
         testCommandLine( null, startDate, endDate,
-                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco" );
+                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\nREVI:%Ln\\n\" -recurse -nco" );
     }
 
     public void testGetCommandLineWithUserPattern()
@@ -57,7 +57,7 @@ public class ClearCaseChangeLogCommandTe
         Date endDate = null;
 
         testCommandLine( null, startDate, endDate,
-                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%-8.8u\\n\" -recurse -nco" );
+                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%-8.8u\\nREVI:%Ln\\n\" -recurse -nco" );
 
         ClearCaseUtil.setSettingsDirectory( ClearCaseUtil.DEFAULT_SETTINGS_DIRECTORY );
     }
@@ -70,7 +70,7 @@ public class ClearCaseChangeLogCommandTe
         Date endDate = null;
 
         testCommandLine( new ScmBranch( "myBranch" ), startDate, endDate,
-                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco -branch myBranch" );
+                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\nREVI:%Ln\\n\" -recurse -nco -branch myBranch"
);
     }
 
     public void testGetCommandLineWithStartDate()
@@ -81,7 +81,7 @@ public class ClearCaseChangeLogCommandTe
         Date endDate = null;
 
         testCommandLine( null, startDate, endDate,
-                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco -since 10-Sep-2003" );
+                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\nREVI:%Ln\\n\" -recurse -nco -since 10-Sep-2003"
);
     }
 
     public void testGetCommandLineWithTagAndStartDate()
@@ -92,7 +92,7 @@ public class ClearCaseChangeLogCommandTe
         Date endDate = null;
 
         testCommandLine( new ScmBranch( "myBranch" ), startDate, endDate,
-                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco -since 10-Sep-2003 -branch
myBranch" );
+                         "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o
- %o - %c - Activity: %[activity]p\\nUSER:%u\\nREVI:%Ln\\n\" -recurse -nco -since 10-Sep-2003
-branch myBranch" );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcaselog.txt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcaselog.txt?rev=1094193&r1=1094192&r2=1094193&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcaselog.txt
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcaselog.txt
Sun Apr 17 20:28:59 2011
@@ -3,13 +3,16 @@ DATE:20040630.145714
 COMM:checkin      - checkin - Added status constants.
  - Activity: Acceptance_Tests_For_Release_to_Instruction_Processor
 USER:88888888
+REVI:9
 NAME:PartyManager\src\java\uk\co\mycompany\util\hibernate
 DATE:20040630.143802
 COMM:checkin      - checkin - Added storing of data.
  - Activity: Acceptance_Tests_For_Release_to_Instruction_Processor
-USER:55555   
+USER:55555
+REVI:133   
 NAME:PartyManager\src\java\uk\co\mycompany\corppay\refdata\model\Submission.java
 DATE:20040630.143759
 COMM:checkin      - checkin - Added storing of data.
  - Activity: Acceptance_Tests_For_Release_to_Instruction_Processor
 USER:martenss
+REVI:55



Mime
View raw message