You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-dev@maven.apache.org by TN...@IBS.RU on 2006/06/09 11:55:16 UTC

BUG in SubVersion SCM ()

Good day!

I’ve tried to checkout my project from SVN repository using your SCM adapter. It seems that it works a little bit incorrectly during parsing SVN output.  (line “Unknown file status: ‘ ‘):

 

 

And that is the result of executing the same svn checkout command (svn --non-interactive checkout http://dir-helper/svn/DB3426/Source/bigFileLoader checkout):

 

 

As you can see file status at last line is printed at second position ( U     checkout). I decompiled org.apache.maven.scm.provider.svn.command.checkout.SvnCheckOutConsumer class and drew attention at method consumeLine:

public void consumeLine(String line)

          {

              if(line.length() <= 3)

              {

                  logger.warn("Unexpected input, the line must be at least three characters long. Line: '" + line + "'.");

                  return;

              }

    String statusString = line.substring(0, 1);

              String file = line.substring(3);

              if(line.startsWith("Checked out revision"))

              {

                  String revisionString = line.substring("Checked out revision".length() + 1, line.length() - 1);

                  try

                  {

                      revision = Integer.parseInt(revisionString);

                  }

                  catch(NumberFormatException ex) { }

                  return;

              }

              ScmFileStatus status;

              if(statusString.equals("A"))

                  status = ScmFileStatus.ADDED;

              else

              if(statusString.equals("U"))

              {

                  status = ScmFileStatus.UPDATED;

              } else

              {

                  logger.info("Unknown file status: '" + statusString + "'.");

                  return;

              }

              if(!(new File(workingDirectory, file)).isFile())

              {

                  return;

              } else

              {

                  checkedOutFiles.add(new ScmFile(file, status));

                  return;

              }

 

Possible solution could be trimming the line variable.

Thanks. I’ll be waiting for your reply and fix.

 

Best regards, Tim Nizametdinov, developer

mailto: tnizametdinov@ibs.ru

 


Re: BUG in SubVersion SCM ()

Posted by Emmanuel Venisse <em...@venisse.net>.
Please, file an issue with eventually a patch and we'll fix it.

Emmanuel

TNizametdinov@IBS.RU a écrit :
> Good day!
> 
> I’ve tried to checkout my project from SVN repository using your SCM 
> adapter. It seems that it works a little bit incorrectly during parsing 
> SVN output.  (line “Unknown file status: ‘ ‘):
> 
>  
> 
> And that is the result of executing the same svn checkout command (svn 
> --non-interactive checkout 
> http://dir-helper/svn/DB3426/Source/bigFileLoader checkout):
> 
>  
> 
> As you can see file status at last line is printed at second position ( 
> U     checkout). I decompiled 
> org.apache.maven.scm.provider.svn.command.checkout.SvnCheckOutConsumer 
> class and drew attention at method /consumeLine/:
> 
> *public void *consumeLine(String line)
> 
>           {
> 
> *              if*(line.length() <= 3)
> 
>               {
> 
>                   logger.warn("Unexpected input, the line must be at 
> least three characters long. Line: '" + line + "'.");
> 
> *                  return*;
> 
>               }
> 
>     String statusString = *line.substring(0, 1);***
> 
>               String file = line.substring(3);
> 
> *              if*(line.startsWith("Checked out revision"))
> 
>               {
> 
>                   String revisionString = line.substring("Checked out 
> revision".length() + 1, line.length() - 1);
> 
> *                  try*
> 
>                   {
> 
>                       revision = Integer.parseInt(revisionString);
> 
>                   }
> 
> *                  catch*(NumberFormatException ex) { }
> 
> *                  return*;
> 
>               }
> 
>               ScmFileStatus status;
> 
> *              if*(statusString.equals("A"))
> 
>                   status = ScmFileStatus.ADDED;
> 
> *              else*
> 
> *              if*(statusString.equals("U"))
> 
>               {
> 
>                   status = ScmFileStatus.UPDATED;
> 
>               } *else*
> 
>               {
> 
>                   logger.info("Unknown file status: '" + statusString + 
> "'.");
> 
> *                  return*;
> 
>               }
> 
> *              if*(!(*new *File(workingDirectory, file)).isFile())
> 
>               {
> 
> *                  return*;
> 
>               } *else*
> 
>               {
> 
>                   checkedOutFiles.add(*new *ScmFile(file, status));
> 
> *                  **return*;
> 
>               }
> 
>  
> 
> Possible solution could be trimming the *line* variable.
> 
> Thanks. I’ll be waiting for your reply and fix.
> 
>  
> 
> Best regards, Tim Nizametdinov, developer
> 
> mailto: tnizametdinov@ibs.ru <ma...@ibs.ru>
> 
>  
>