ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/cvslib CvsTagDiff.java
Date Thu, 06 Nov 2003 09:27:21 GMT
antoine     2003/11/06 01:27:21

  Modified:    src/main/org/apache/tools/ant/taskdefs/cvslib Tag:
                        ANT_16_BRANCH CvsTagDiff.java
  Log:
  Merge from HEAD
  solve issue with cvstagdiff running against cvs 1.11.9 or higher
  concerning the parsing of revisions for new files
  PR: 24406
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.16.2.2  +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.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- CvsTagDiff.java	14 Oct 2003 13:20:12 -0000	1.16.2.1
  +++ CvsTagDiff.java	6 Nov 2003 09:27:21 -0000	1.16.2.2
  @@ -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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message