Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368021

Summary: CVS keyword expansion confuses Eclipse CVS annotate
Product: [Eclipse Project] Platform Reporter: Raoul Gough <raoulgough>
Component: CVSAssignee: platform-cvs-inbox <platform-cvs-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.2   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=52662
Whiteboard: stalebug
Attachments:
Description Flags
Annotations not moved when log shown
none
Screenshot showing CVS annotations with $Log:$ after two commits none

Description Raoul Gough CLA 2012-01-06 06:40:37 EST
Build Identifier: I20100608-0911

In a file with cvs $Log:$ keyword expansion, the Eclipse "Team - Show Annotation" view can produce annotation bars on the left of the Eclipse editor view that are misaligned with respect to the text in the editor.

I think this can easily be explained because the text in the editor has undergone keyword expansion during CVS checkout, whereas the CVS "annotate" command reports only the server-side version of the file contents, without keyword expansion. Therefore the annotation output typically contains fewer lines than the editor version.

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=52662 which might have been an earlier report of the same problem.

I've reproduced this with the given Eclipse build on Windows and Linux.

Reproducible: Always

Steps to Reproduce:
1. Create a new text file within a CVS-based project, called e.g. eclipse_cvs_annotate_test.txt, and insert the following lines:
Line committed in revision 1.1

$Log:$

Another line committed in revision 1.1

2. Use Team - Commit, enter a comment like "Comment entered in initial commit" and commit the file. The editor window should then have something like the following:
Line committed in revision 1.1

$Log: eclipse_cvs_annotate_test.txt,v $
Revision 1.1  2012/01/06 10:29:27  USERID
Comment entered in initial commit

Another line committed in revision 1.1

3. Use Team - Show Annotation to show the annotation bars on the left of the editor window

Note that the (single) annotation bar extends from the first line down to somewhere within the contents of the $Log$ expansion, and stops before the end of the file. Compare this with the raw command-line output of "cvs annotate" on the same file:

$ cvs annotate eclipse_cvs_annotate_test.txt

Annotations for eclipse_cvs_annotate_test.txt
***************
1.1          (USERID   06-Jan-12): Line committed in revision 1.1
1.1          (USERID   06-Jan-12): 
1.1          (USERID   06-Jan-12): $Log:$
1.1          (USERID   06-Jan-12): 
1.1          (USERID   06-Jan-12): Another line committed in revision 1.1

Note that the cvs annotate output does not include the keyword expansion. This leads to misalignment in Eclipse of the bars with respect to all subsequent lines in the file.
Comment 1 Malgorzata Janczarska CLA 2012-01-10 05:10:55 EST
Created attachment 209249 [details]
Annotations not moved when log shown

I was able to reproduce it. It seems that annotations are not moved when log is expanded in the view. What is strange when I do the second change and commit it annotations are shown correctly.
Comment 2 Raoul Gough CLA 2012-01-11 06:24:43 EST
Created attachment 209306 [details]
Screenshot showing CVS annotations with $Log:$ after two commits
Comment 3 Raoul Gough CLA 2012-01-11 06:30:55 EST
After the second commit I still see the problem. I've attached a screenshot (from Linux Eclipse Version: 3.6.0 Build id: I20100608-0911). Note that the first three lines are correct ("Line committed in revision...") but things go wrong where it indicates revision 1.2 along the text for the commit comment "Revision 1.2  2012/01/06 13:30:14  USERID...". Also, the last six lines are not marked with any annotation (I included a multi-line comment when commiting 1.2 to make this more obvious).

Here's the raw CVS annotate corresponding to the screenshot, note that the $Log:$ expansion from the server does not include the commit comment above.

Annotations for eclipse_cvs_annotate_test.txt
***************
1.1          (USERID   06-Jan-12): Line committed in revision 1.1
1.2          (USERID   06-Jan-12): Line committed in revision 1.2
1.1          (USERID   06-Jan-12): 
1.2          (USERID   06-Jan-12): $Log: eclipse_cvs_annotate_test.txt,v $
1.2          (USERID   06-Jan-12): Revision 1.1  2012/01/06 10:29:27  USERID
1.2          (USERID   06-Jan-12): Comment entered in initial commit
1.1          (USERID   06-Jan-12): 
1.2          (USERID   06-Jan-12): Another line committed in revision 1.2 
1.1          (USERID   06-Jan-12): Another line committed in revision 1.1
Comment 4 Lars Vogel CLA 2019-11-14 03:40:01 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.
Comment 5 Raoul Gough CLA 2019-12-04 01:41:49 EST
Probably nobody really cares about CVS in Eclipse anymore (I certainly don't and I was the original bug submitter). It was probably never a good idea to use the $Log:$ keyword in the first place, anyway.