ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/scm AntStarTeamCheckOut.java
Date Tue, 22 Aug 2000 15:54:16 GMT
conor       00/08/22 08:54:16

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/scm
                        AntStarTeamCheckOut.java
  Log:
  Fixes checkout directory under windows (current version lobs off last
  character).
  
  Submitted by:	Eric VanLydegraf <ericv@kinzan.com>
  
  Revision  Changes    Path
  1.2       +10 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java
  
  Index: AntStarTeamCheckOut.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AntStarTeamCheckOut.java	2000/08/21 15:05:55	1.1
  +++ AntStarTeamCheckOut.java	2000/08/22 15:54:16	1.2
  @@ -660,9 +660,16 @@
   		String dirName = v.getDefaultPath();
   		// Settle on "/" as the default path separator for this purpose only.
   		dirName = dirName.replace('\\', '/');
  -		// Take the StarTeam folder name furthest down in the hierarchy.
  -		dirName = dirName.substring(dirName.lastIndexOf("/", dirName.length() - 2) + 1, dirName.length()
- 1);
  -
  +                // Take the StarTeam folder name furthest down in the hierarchy.
  +                int endDirIndex = dirName.length();
  +                // If it ends with separator then strip it off
  +                if (dirName.endsWith("/"))
  +                {
  +                    // This should be the SunOS and Linux case
  +                    endDirIndex--;
  +                }
  +		dirName = dirName.substring(dirName.lastIndexOf("/", dirName.length() - 2) + 1, endDirIndex);
  +                
   		// Replace the projectName in the file's absolute path to the viewName.
   		// This eventually makes the target of a checkout operation equal to:
   		// targetFolder + dirName + [subfolders] + itemName
  
  
  

Mime
View raw message