[
https://issues.apache.org/jira/browse/SCM-560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17962063#comment-17962063
]
ASF GitHub Bot commented on SCM-560:
------------------------------------
jira-importer opened a new issue, #769:
URL: https://github.com/apache/maven-scm/issues/769
**[William
Bernardet](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=wbernard)**
opened
**[SCM-560](https://issues.apache.org/jira/browse/SCM-560?redirect=false)** and
commented
The HgRevNoConsumer is parsing the output of hg id command using the full
line and assuming the revision is a number matching [0-9] numbers
https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java
Mercurial can return an id with the revision branch and tag label e.g:
58bda09e68fa tip
or if the repo contains uncommited changes:
58bda09e68fa+ tip
The extraction of the revision should be updated by splitting the line and
take the first part only and then remove the ending '+' if needed. Then the
resulting string should be converted using radix 16 (int is not able to store
the result), code should be something like that:
long revision = Long.parse(line.split("\\s+")[0].trim("+"), 16);
---
1 votes, 2 watchers
> The capturing of mercurial revision is invalid
> ----------------------------------------------
>
> Key: SCM-560
> URL: https://issues.apache.org/jira/browse/SCM-560
> Project: Maven SCM (Moved to GitHub Issues)
> Issue Type: Bug
> Components: maven-scm-provider-mercurial (hg)
> Environment: Windows + JDK6 + Ant
> Reporter: William Bernardet
> Priority: Major
>
> The HgRevNoConsumer is parsing the output of hg id command using the full
> line and assuming the revision is a number matching [0-9] numbers
> https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.java
> Mercurial can return an id with the revision branch and tag label e.g:
> 58bda09e68fa tip
> or if the repo contains uncommited changes:
> 58bda09e68fa+ tip
> The extraction of the revision should be updated by splitting the line and
> take the first part only and then remove the ending '+' if needed. Then the
> resulting string should be converted using radix 16 (int is not able to store
> the result), code should be something like that:
> long revision = Long.parse(line.split("\\s+")[0].trim("+"), 16);
--
This message was sent by Atlassian Jira
(v8.20.10#820010)