antoine     2003/11/06 01:21:37

  Modified:    src/main/org/apache/tools/ant/taskdefs/cvslib
                        CvsTagDiff.java
  Log:
  Solve parsing of revisions for new files
  with CVS 1.11.9 or higher
  PR: 24406
  
  Revision  Changes    Path
  1.18      +15 -3     
ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
  
  Index: CvsTagDiff.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CvsTagDiff.java   14 Oct 2003 13:19:53 -0000      1.17
  +++ CvsTagDiff.java   6 Nov 2003 09:21:36 -0000       1.18
  @@ -113,7 +113,11 @@
       /**
        * Token to identify a new file in the rdiff log
        */
  -    static final String FILE_IS_NEW = " is new; current revision ";
  +    static final String FILE_IS_NEW = " is new;";
  +    /**
  +     * Token to identify the revision
  +     */
  +    static final String REVISION = "revision ";
   
       /**
        * Token to identify a modified file in the rdiff log
  @@ -300,10 +304,18 @@
                       line = line.substring(headerLength);
   
                       if ((index = line.indexOf(FILE_IS_NEW)) != -1) {
  +//CVS 1.11
  +//File apps/websphere/lib/something.jar is new; current revision 1.2
  +//CVS 1.11.9
  +//File apps/websphere/lib/something.jar is new; cvstag_2003_11_03_2 revision 
1.2
                           // it is a new file
                           // set the revision but not the prevrevision
                           String filename = line.substring(0, index);
  -                        String rev = line.substring(index + 
FILE_IS_NEW.length());
  +                        String rev = null;
  +                        int indexrev = -1;
  +                        if ((indexrev = line.indexOf(REVISION, index)) != 
-1) {
  +                            rev = line.substring(indexrev + 
REVISION.length());
  +                        }
                           entry = new CvsTagEntry(filename, rev);
                           entries.addElement(entry);
                           log(entry.toString(), Project.MSG_VERBOSE);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to