MANUAL FIXES for jaga from StarTeam MANUAL_FIXES_FROM_ST_jaga
authorjglick@netbeans.org
Tue, 25 Apr 2000 07:40:35 +0000
changeset 17087096058c1bf
parent 169 eb1e1f73e547
child 171 45071ee86ec6
MANUAL FIXES for jaga from StarTeam
vcscvs/src/org/netbeans/modules/vcs/cmdline/commands/CvsModuleSelectorDialog.java
vcscvs/src/org/netbeans/modules/vcs/cmdline/list/CvsListRecursiveCommand.java
     1.1 --- a/vcscvs/src/org/netbeans/modules/vcs/cmdline/commands/CvsModuleSelectorDialog.java	Wed Apr 05 06:06:32 2000 +0000
     1.2 +++ b/vcscvs/src/org/netbeans/modules/vcs/cmdline/commands/CvsModuleSelectorDialog.java	Tue Apr 25 07:40:35 2000 +0000
     1.3 @@ -28,6 +28,7 @@
     1.4    private boolean validSelection = false;
     1.5    //private volatile InformationDialog waitDlg = null;
     1.6    
     1.7 +  static final long serialVersionUID = 1987612235843595460L;
     1.8    /** Creates new form CvsModuleSelectorDialog */
     1.9    public CvsModuleSelectorDialog(java.awt.Frame parent,boolean modal) {
    1.10      super (parent, modal);
     2.1 --- a/vcscvs/src/org/netbeans/modules/vcs/cmdline/list/CvsListRecursiveCommand.java	Wed Apr 05 06:06:32 2000 +0000
     2.2 +++ b/vcscvs/src/org/netbeans/modules/vcs/cmdline/list/CvsListRecursiveCommand.java	Tue Apr 25 07:40:35 2000 +0000
     2.3 @@ -80,7 +80,7 @@
     2.4        this.dir = ""; // NOI18N
     2.5        //vars.put("DIR","."); // NOI18N
     2.6      }
     2.7 -    this.dirPath = dir.replace(java.io.File.pathSeparatorChar, '/');
     2.8 +    this.dirPath = dir.replace(java.io.File.separatorChar, '/');
     2.9      String module = (String) vars.get("MODULE"); // NOI18N
    2.10      D.deb("rootDir = "+rootDir+", module = "+module+", dir = "+dir); // NOI18N
    2.11      if (dir.equals("")) { // NOI18N
    2.12 @@ -92,6 +92,7 @@
    2.13        else
    2.14          dir=rootDir+File.separator+module+File.separator+dir;
    2.15      }
    2.16 +    if (module.length() > 0) this.cvsRepository += "/"+module.replace('\\', '/');
    2.17      if (dir.charAt(dir.length() - 1) == File.separatorChar)
    2.18        dir = dir.substring(0, dir.length() - 1);
    2.19      D.deb("dir="+dir); // NOI18N
    2.20 @@ -159,30 +160,24 @@
    2.21      }
    2.22    }
    2.23  
    2.24 -  //------------------------------------------
    2.25 -  private boolean furtherExamining(String data, int index) {
    2.26 -    while(Character.isWhitespace(data.charAt(index))) index++;
    2.27 -    return (data.charAt(index) == '.');
    2.28 -  }
    2.29 -  
    2.30 -  private String getExaminingPath(String data, int index) {
    2.31 -    String path = null;
    2.32 -    while(Character.isWhitespace(data.charAt(index))) index++;
    2.33 -    int indexnl = data.indexOf('\n', index);
    2.34 -    if (indexnl < 0) indexnl = data.length();
    2.35 -    path = data.substring(index, indexnl);
    2.36 -    return path;
    2.37 -  }
    2.38 -  
    2.39 + 
    2.40 +  /**
    2.41 +   * Get the path of file from the output information at given index.
    2.42 +   * @param data the output data
    2.43 +   * @param index the index to the file information
    2.44 +   */
    2.45    private String getFilePath(String data, int index) {
    2.46 -    int begin = data.indexOf('/', index);
    2.47 -    if (begin < 0) return null;
    2.48 +    int begin = index;
    2.49 +    while(Character.isWhitespace(data.charAt(begin))) begin++; // skip the space
    2.50 +    while(!Character.isWhitespace(data.charAt(begin))) begin++; // skip the revision number
    2.51 +    while(Character.isWhitespace(data.charAt(begin))) begin++; // skip the space
    2.52      int end = data.indexOf('\n', begin);
    2.53      if (end < 0) return null;
    2.54      String path = data.substring(begin, end);
    2.55      D.deb("getFilePath(): path = "+path);
    2.56      int nameIndex = path.lastIndexOf('/');
    2.57      D.deb("nameIndex = "+nameIndex);
    2.58 +    if (nameIndex < 0) return null;
    2.59      if (nameIndex == 0) return (cvsRepository.length() > 0) ? null : "";
    2.60      path = path.substring(0, nameIndex);
    2.61      index = path.indexOf(cvsRepository);
    2.62 @@ -194,31 +189,11 @@
    2.63        return path.substring(index + cvsRepository.length() + 1);
    2.64    }
    2.65    
    2.66 +
    2.67    /**
    2.68 -   * Find out the position of the examining info when it is on the first line
    2.69 -   * after given the position.
    2.70 -   * @param data the data to examine
    2.71 -   * @param index the index to start searching from
    2.72 -   * @return the position of the last character of the examining info if it was found,
    2.73 -   *         or a negative number otherwise
    2.74 +   * Get files and their statuses from the command output.
    2.75 +   * @param filesByNameCont the container of files.
    2.76     */
    2.77 -  private int getExaminingInfo(String data, int index) {
    2.78 -    int indexnl = data.indexOf('\n', index);
    2.79 -    int indexe = data.length() + 10; // anything more than length
    2.80 -    for(int i = 0; i < examiningStrs.length; i++) {
    2.81 -      int ind = data.indexOf(examiningStrs[i], index);
    2.82 -      if (ind >= 0) {
    2.83 -        ind += examiningStrs[i].length();
    2.84 -        if (ind < indexe) indexe = ind;
    2.85 -      }
    2.86 -    }
    2.87 -    if (indexe > data.length()) return -1; // no examining info no more
    2.88 -    if (indexe < indexnl) return indexe;
    2.89 -    else return -1;
    2.90 -  }
    2.91 -
    2.92 -
    2.93 -  //-------------------------------------------
    2.94    private void fillHashtable(VcsDirContainer filesByNameCont) {
    2.95      String data=new String(dataBuffer);
    2.96      Hashtable filesByName = new Hashtable();
    2.97 @@ -271,6 +246,7 @@
    2.98          pos = data.length();
    2.99          continue;
   2.100        }
   2.101 +      repositoryIndex += "Repository revision:".length();
   2.102        String filePath = getFilePath(data, repositoryIndex);
   2.103        if (filePath != null && !filePath.equals(last_filePath)) {
   2.104          VcsDirContainer parent = VcsDirContainer.getParent(filePath, filesByNameCont);
   2.105 @@ -343,7 +319,8 @@
   2.106     * List files of CVS Repository recursively.
   2.107     * @param vars Variables used by the command
   2.108     * @param args Command-line arguments
   2.109 -   * filesByName listing of files with statuses
   2.110 +   * @param filesByNameCont listing of files with statuses. For each directory there is a <code>Hashtable</code>
   2.111 +   *                        with files.
   2.112     * @param stdoutNRListener listener of the standard output of the command
   2.113     * @param stderrNRListener listener of the error output of the command
   2.114     * @param stdoutListener listener of the standard output of the command which
   2.115 @@ -375,58 +352,12 @@
   2.116      return !shouldFail;
   2.117    }
   2.118  
   2.119 +  /**
   2.120 +   * Matches the standard output of the command.
   2.121 +   * @param elements a line of output
   2.122 +   */
   2.123    public void match(String[] elements) {
   2.124      dataBuffer.append(elements[0]+"\n"); // NOI18N
   2.125      D.deb("match: append line '"+elements[0]+"'"); // NOI18N
   2.126 -    /*
   2.127 -    String data = elements[0];
   2.128 -    int pos = 0;
   2.129 -    int examIndex = getExaminingInfo(data, pos);
   2.130 -    if (examIndex > 0) {
   2.131 -      String path = getExaminingPath(data, examIndex);
   2.132 -      if (path.equals(".")) {
   2.133 -        filesByNameCont.setPath(dirPath);
   2.134 -        filesByName = new Hashtable();
   2.135 -        filesByNameCont.setElement(filesByName);
   2.136 -        D.deb("setting path for root: "+dirPath);
   2.137 -      } else {
   2.138 -        if (dirPath.length() > 0) path = dirPath+"/"+path;
   2.139 -        filesByNameContPath.setElement(filesByName);
   2.140 -        VcsDirContainer parent = VcsDirContainer.getParent(path, filesByNameCont);
   2.141 -        if (parent != null) filesByNameContPath = parent.addSubdir(path);
   2.142 -        else filesByNameContPath = filesByNameCont.addSubdir(path);
   2.143 -        filesByName = new Hashtable();
   2.144 -        filesByNameContPath.setElement(filesByName);
   2.145 -        D.deb("created new Container with path: "+path);
   2.146 -      }
   2.147 -    } else {
   2.148 -      int fileIndex=data.indexOf("File:",pos); // NOI18N
   2.149 -      int statusIndex=data.indexOf("Status:",pos); // NOI18N
   2.150 -      if (fileIndex >= 0 && statusIndex >= 0) {
   2.151 -        D.deb("fillHashtable: fileIndex = "+fileIndex+", statusIndex = "+statusIndex); // NOI18N
   2.152 -        fileIndex+="File:".length(); // NOI18N
   2.153 -        String fileName=data.substring(fileIndex,statusIndex).trim();
   2.154 -        int i=-1;
   2.155 -        if( (i=fileName.indexOf("no file")) >=0  ){ // NOI18N
   2.156 -          fileName=fileName.substring(i+7).trim();
   2.157 -        }
   2.158 -        //D.deb("fileName="+fileName); // NOI18N
   2.159 -
   2.160 -        //String fileDetails=data.substring(index,nextIndex);
   2.161 -        //D.deb("fileDetails="+fileDetails); // NOI18N
   2.162 -
   2.163 -        statusIndex+="Status:".length(); // NOI18N
   2.164 -        String fileStatus=data.substring(statusIndex).trim();
   2.165 -        //D.deb("fileStatus="+fileStatus); // NOI18N
   2.166 -
   2.167 -        D.deb("fillHashTable: "+"fileName="+fileName+", fileStatus="+fileStatus); // NOI18N
   2.168 -
   2.169 -        String[] fileStatuses = new String[2];
   2.170 -        fileStatuses[0] = fileName;
   2.171 -        fileStatuses[1] = fileStatus;
   2.172 -        filesByName.put(fileName,fileStatuses);
   2.173 -      }
   2.174 -    }
   2.175 -    */
   2.176    }
   2.177  }
   2.178 \ No newline at end of file