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.info;
|
|
19 |
|
628
|
20 |
import org.apache.maven.scm.ScmFileStatus;
|
587
|
21 |
import org.apache.maven.scm.log.ScmLogger;
|
628
|
22 |
import org.apache.maven.scm.provider.hg.command.HgConsumer;
|
|
23 |
|
587
|
24 |
|
|
25 |
/**
|
|
26 |
* Consumer of 'hg info' command output.
|
|
27 |
*/
|
628
|
28 |
public class HgInfoConsumer extends HgConsumer {
|
587
|
29 |
private String scmRevision = new String();
|
628
|
30 |
|
|
31 |
public HgInfoConsumer(ScmLogger logger) {
|
|
32 |
super(logger);
|
587
|
33 |
}
|
|
34 |
|
|
35 |
/** {@inheritDoc} */
|
628
|
36 |
public void doConsume(ScmFileStatus status, String trimmedLine) {
|
587
|
37 |
String[] tagging = trimmedLine.split(" ");
|
|
38 |
if (tagging.length == 2) {
|
628
|
39 |
this.scmRevision = tagging[0];
|
|
40 |
}
|
587
|
41 |
}
|
628
|
42 |
|
|
43 |
public String getRevision() {
|
587
|
44 |
return scmRevision;
|
|
45 |
}
|
|
46 |
}
|