buildframework/helium/sf/java/scm/src/com/nokia/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.java
changeset 628 7c4a911dc066
parent 587 85df38eb4012
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5  * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  
    14  * Description:  
    15 *
    15  *
    16 */
    16  */
    17 
       
    18 
    17 
    19 package com.nokia.maven.scm.provider.hg.command.checkout;
    18 package com.nokia.maven.scm.provider.hg.command.checkout;
    20 
    19 
    21 import org.apache.maven.scm.provider.ScmProviderRepository;
    20 import org.apache.maven.scm.ScmException;
    22 import org.apache.maven.scm.ScmFileSet;
    21 import org.apache.maven.scm.ScmFileSet;
    23 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
       
    24 import org.apache.maven.scm.ScmResult;
    22 import org.apache.maven.scm.ScmResult;
    25 import org.apache.maven.scm.ScmVersion;
    23 import org.apache.maven.scm.ScmVersion;
    26 import org.apache.maven.scm.ScmException;
    24 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
       
    25 import org.apache.maven.scm.provider.ScmProviderRepository;
       
    26 
    27 
    27 
    28 /**
    28 /**
    29  */
    29  */
    30 public class HgCheckOutCommand
    30 public class HgCheckOutCommand extends
    31     extends org.apache.maven.scm.provider.hg.command.checkout.HgCheckOutCommand
    31     org.apache.maven.scm.provider.hg.command.checkout.HgCheckOutCommand {
    32 {
       
    33     /** {@inheritDoc} */
    32     /** {@inheritDoc} */
    34     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
    33     protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repo,
    35                                                         ScmVersion scmVersion )
    34         ScmFileSet fileSet, ScmVersion scmVersion) throws ScmException {
    36         throws ScmException
    35         CheckOutScmResult result = super.executeCheckOutCommand(repo, fileSet, scmVersion);
    37     {
    36         if (result.getCheckedOutFiles().size() == 0 && !result.isSuccess()
    38            CheckOutScmResult result = super.executeCheckOutCommand(repo, fileSet, scmVersion);
    37             && result.getProviderMessage().contains("locate failed with exit code: 1.")) {
    39            if (result.getCheckedOutFiles().size() == 0 && !result.isSuccess() && result.getProviderMessage().contains("locate failed with exit code: 1.")) {
    38             getLogger().info("Fixing locate calls which returns 1 when no files are found.");
    40                getLogger().info("Fixing locate calls which returns 1 when no files are found.");
    39             result = new CheckOutScmResult(result.getCheckedOutFiles(), new ScmResult(result.getCommandLine(), result.getProviderMessage(), result.getCommandOutput(), true));
    41                result = new CheckOutScmResult(result.getCheckedOutFiles(), new ScmResult(result.getCommandLine(), result.getProviderMessage(), result.getCommandOutput(), true));
    40         }
    42            }
    41         return result;
    43            return result;
       
    44     }
    42     }
    45        
    43 
    46 }
    44 }