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