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