Ticket #181 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

A few glitches in the new Annotation support

Reported by: Jerome Negre <jerome+hg@…> Owned by: zingo
Priority: major Milestone: Release 0.3.x
Component: MercurialEclipse Version: 0.1.x
Keywords: Cc:

Description

A few points I noted:

  • the parsing of the date does not set the locale which leads to [1] on non-english locales
  • the regexp in AnnotateCommand? does not match for some authors [2] which leads to [3]
  • ShowAnnotationOperation? use an internal package of Eclipse (org.eclipse.ui.internal.ide.IDEWorkbenchPlugin) that might move/be renamed/disappear any time (I've already made this mistake in another plugin, I know what I'm talking about)

[1]

java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Thu Apr 20 23:14:10 2006 +0200"
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.createFromStdOut(AnnotateCommand.java:104)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.createFromStdOut(AnnotateCommand.java:79)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.run(AnnotateCommand.java:70)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.execute(AnnotateCommand.java:50)
	at com.vectrace.MercurialEclipse.annotations.ShowAnnotationOperation.run(ShowAnnotationOperation.java:70)
	at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$3.run(ProgressDialogRunnableContext.java:100)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
	at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$2.run(ProgressDialogRunnableContext.java:97)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: java.text.ParseException: Unparseable date: "Thu Apr 20 23:14:10 2006 +0200"
	at java.text.DateFormat.parse(Unknown Source)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.createFromStdOut(AnnotateCommand.java:97)
	... 8 more

[2]

jerome+hg 2 b041da22a7f8 Wed Mar 12 20:12:09 2008 +0100: some blabla

[3]

java.lang.RuntimeException: java.lang.IllegalStateException: No match found
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.createFromStdOut(AnnotateCommand.java:104)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.createFromStdOut(AnnotateCommand.java:79)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.run(AnnotateCommand.java:70)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.execute(AnnotateCommand.java:50)
	at com.vectrace.MercurialEclipse.annotations.ShowAnnotationOperation.run(ShowAnnotationOperation.java:70)
	at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$3.run(ProgressDialogRunnableContext.java:100)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
	at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$2.run(ProgressDialogRunnableContext.java:97)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: java.lang.IllegalStateException: No match found
	at java.util.regex.Matcher.group(Unknown Source)
	at com.vectrace.MercurialEclipse.annotations.AnnotateCommand.createFromStdOut(AnnotateCommand.java:94)
	... 8 more

Attachments

bug181.patch (2.2 kB) - added by Charles O'Farrell <charleso@…> 5 months ago.
Deprecated Fix

Change History

Changed 5 months ago by Jerome Negre <jerome+hg@…>

By the way, I am not working on fixing those bugs.

Changed 5 months ago by StefanC

Ive also experienced the regexp failing on some blank lines while parsing.

Changed 5 months ago by StefanC

my blank lines are gone in mercurial 1.0, since they now use binary std.out, this fixes a number of problems. and aparantly introduces other we've compensated before earlier :D

Changed 5 months ago by Jerome Negre <jerome+hg@…>

A quick diff to fix the blocking bugs I've seen. Seems to be ok, but I didn't test that much: it would probably be better to wait for the original contributor.

Changed 5 months ago by zingo

  • version set to 0.1.x
  • milestone set to Release 0.3.x

Pulled the diff, thanx

Changed 5 months ago by Charles O'Farrell <charleso@…>

Deprecated Fix

Changed 5 months ago by Charles O'Farrell <charleso@…>

Hi guys,

Firstly, thanks again to Jerome for fixing my silly mistakes in the annotation command. If it works for you and isn't hacky then I'm happy with it. If there's a better way of parsing the annotation output then I'm all for it as well.

In relation to the deprecated class I've replaced this with a reference to EditorsUI, which has the same constant and isn't deprecated. After some googling it seems like some people just hard-code the string value "org.eclipse.ui.DefaultTextEditor?" in their plugins.

For the record I just copied all the annotation code from the Subclipse project (which is why Zingo had to go to EPL). I didn't see any point in reinventing the wheel.

Great work everyone by the way.

Charles

Changed 5 months ago by zingo

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.