public void everythingFinishedImpl()

in src/com/intellij/vssSupport/commands/StatusMultipleCommand.java [93:186]


    public void everythingFinishedImpl( final String output )
    {
      String lastVssFolder = null;
      String[] lines = LineTokenizer.tokenize( output, false );
      VSSExecUtil.LOG.info( "--- MultipleStatus --- " );
      VSSExecUtil.LOG.info( "\n" + output );
      VSSExecUtil.LOG.info( "--- MultipleStatus end --- " );

      for (int i = 0; i < lines.length; i++)
      {
        String line = lines[ i ];

        // $/longpathupdateproblem/src/com/idea/mytest/ratherLongPackageName/firstSubPacka
        // ge/secondSubpackage/TestNameToTestVSS:
        // Rttt.java           Lloix         Exc   4-23-07  4:18p  D:\Projects\Test
        // Projects\p2_renamed_project\src\com\idea\mytest\ratherLongPackageName\firstSubP
        // ackage\secondSubpackage\TestNameToTestVSS

        // $/longpathupdateproblem/src/first/second/third/forth/fifth/sixth/seventh/eith/n
        // inth/tenth/ratherLongPackage/isntitlongenough/pp1:
        // T2.java             Lloix         Exc   4-23-07  4:18p  D:\Projects\Test
        // Projects\p2_renamed_project\src\first\second\third\forth\fifth\sixth\seventh\ei
        // th\ninth\tenth\ratherLongPackage\isntitlongenough\pp1
        // T3.java             Lloix         Exc   4-23-07  4:18p  D:\Projects\Test
        // Projects\p2_renamed_project\src\first\second\third\forth\fifth\sixth\seventh\ei
        // th\ninth\tenth\ratherLongPackage\isntitlongenough\pp1
         if( line.startsWith( "$" ) )
        {
          int index_1 = line.indexOf(DELETED_MESSAGE);
          int index_2 = line.indexOf(NOT_EXISTING_MESSAGE);

          if (index_1 != -1) {
            String file = line.substring(0, index_1).trim();
            file = VssUtil.getLocalPath(file, myProject);
            file = VssUtil.getCanonicalLocalPath(file);
            deletedFiles.add(file.toLowerCase());
          }
          else
          if (index_2 != -1)
          {
            String file = line.substring(0, index_2).trim();
            file = VssUtil.getLocalPath(file, myProject);
            file = VssUtil.getCanonicalLocalPath(file);
            nonexistingFiles.add(file.toLowerCase());
          }
          else
          if( StringUtil.endsWithChar(line, ':'))
          {
            lastVssFolder = line.substring(0, line.length() - 1);
          }
          else
          if( i < lines.length - 1 && !lines[ i + 1 ].startsWith( "$" ) &&
              StringUtil.endsWithChar( lines[ i + 1 ], ':' ) )
          {
            lastVssFolder = line + lines[ i + 1 ].substring( 0, lines[ i + 1 ].length() - 1 );
            i++;
          }
        }
        else
        {
          if( /*lastVssFolder != null &&*/ line.length() > 20 && line.charAt(19) == ' ')
          {
            String file = line.substring(0, 19).trim();
            boolean mayBeTruncated = line.charAt(18) != ' ';

            //  MegaShit!!!
            //  Sometimes (e.g. when the name of a user is large enough, like
            //  Alexander.Chernikov) the information on checked out file is given
            //  WITHOUT the preceeding vss subproject path. In such case, just
            //  guess on the file given the list of files that we gave to the Status
            //  command as input.
            if( lastVssFolder == null )
            {
              file = guessOnFilePath( file, mayBeTruncated );
            }
            else
            {
              if( mayBeTruncated )
                file = guessOnFileName( file );

              file = lastVssFolder + "/" + file;
              file = VssUtil.getLocalPath( file, myProject );
            }

            //  If the VSS->local path conversion failed, simply do noting
            if( file != null )
            {
              file = VssUtil.getCanonicalLocalPath( file );
              checkoutFiles.add( file.toLowerCase() );
            }
          }
        }
      }
    }