Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 123982 - Annotate fails when revision numbers differ in digit length
Annotate fails when revision numbers differ in digit length
Status: RESOLVED FIXED
Product: versioncontrol
Classification: Unclassified
Component: Mercurial
6.x
All All
: P3 (vote)
: 6.x
Assigned To: issues@versioncontrol
issues@versioncontrol
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-13 21:44 UTC by Jesse Glick
Modified: 2008-01-03 09:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
Proposed patch (3.50 KB, text/plain)
2007-12-20 15:45 UTC, John Rice
Details
Patch to correct Pattern (1014 bytes, text/plain)
2007-12-21 10:22 UTC, John Rice
Details
Patch to work around Pattern issue with content colons (1.62 KB, text/plain)
2007-12-21 10:59 UTC, John Rice
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-12-13 21:44:59 UTC
From the command line, I run annotate on a file and get results like:

 7154: <?xml version="1.0" encoding="UTF-8"?>
 7154: <!--
10972: DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 7154: 
10972: Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 7154: 
10972: 
[....]

From NB, using the latest Hg NBM, the 10972 lines are correctly annotated, but the 7154 lines are marked just "jlahoda"
(the author) and are missing a log message.

The reason is clear from looking at AnnotateAction.toAnnotateLines, which falsely assumes that there is only one space
between the author and the revision number, thus misparsing the whole line.

Anyway it would be simpler and clearer to use a regular expression in this case: extract the necessary info using
Matcher.group(int), and log a warning in case the regexp fails to match.
Comment 1 Jesse Glick 2007-12-18 20:12:46 UTC
BTW I just tried running annotate from the IDE (using today's version of the NBM) on

main/ant.freeform/src/org/netbeans/modules/ant/freeform/Actions.java

(from hg.netbeans.org) and it does not work at all. Shows annotations on only a handful of lines; some with version
number, some without. In this case all the version numbers are 5 digits, I think.
Comment 2 John Rice 2007-12-20 15:45:50 UTC
Created attachment 54417 [details]
Proposed patch
Comment 3 John Rice 2007-12-20 15:59:10 UTC
Committed to Head:

IDE:-------------------------------------------------
IDE: [20/12/07 15:58] Committing "AnnotateAction.java" started
Checking in AnnotateAction.java;
/shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/AnnotateAction.java,v
 <--  AnnotateAction.java
new revision: 1.8; previous revision: 1.7
done
IDE: [20/12/07 15:58] Committing "AnnotateAction.java" finished
IDE: [20/12/07 15:58] Diffing finished
IDE: [20/12/07 15:58] Diffing finished
Comment 4 John Rice 2007-12-20 17:48:49 UTC
Note: command used to fetch test data:

$ hg clone https://<netbeans user id>:hguser@hg.netbeans.org/main main
Comment 5 John Rice 2007-12-21 10:22:04 UTC
Created attachment 54443 [details]
Patch to correct Pattern
Comment 6 John Rice 2007-12-21 10:59:11 UTC
Created attachment 54444 [details]
Patch to work around Pattern issue with content colons
Comment 7 John Rice 2007-12-21 11:00:50 UTC
Seems to be a Pattern bug where (\\b.*): is not matching filename and first colon, but matches colon in content. Changed
to use (\\b\\S*): for any non-White space char match and all lines are correctly annotated now.

IDE:-------------------------------------------------
IDE: [21/12/07 10:57] Committing started
Checking in ui/annotate/AnnotateAction.java;
/shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/annotate/AnnotateAction.java,v
 <--  AnnotateAction.java
new revision: 1.10; previous revision: 1.9
done
Checking in FileInformation.java;
/shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/FileInformation.java,v  <-- 
FileInformation.java
new revision: 1.6; previous revision: 1.5
done
IDE: [21/12/07 10:57] Committing finished
IDE: [21/12/07 10:57] Diffing finished


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo