Ticket #179 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

Nice to have worked version for Eclipse 3.3 and hg 1.0

Reported by: anonymous Owned by: zingo
Priority: major Milestone: Release 0.2.x
Component: MercurialEclipse Version: Future
Keywords: Cc:

Description

It is nice to have plugin version with worked commit functionality for Eclipse 3.3 and hg 1.0

Change History

Changed 5 months ago by zingo

What problem do you have? I use Eclipse 3.3 (linux) myself but I havn't tried hg 1.0 yet. There are some known issues with windows see ticker #166 is that what you have problem with?

Changed 5 months ago by Sebastian

I think i am able to reproduce it on Windows. The command created is correct but the file names are wrong. In ActionCommit?.java at run() you end up with corrupted file names at String filename=MercurialUtilities?.getResourceName(oneFile,workingDir); It seems to be the same issue as ticket #166.

Changed 5 months ago by Sebastian

Seems like hg 1.0 got a change on windows, quoting UpdateNotes? from http://www.selenic.com/mercurial/wiki/index.cgi/UpgradeNotes

"hg" script sets Windows standard streams to binary mode at startup to avoid CR corruption in redirections

So now the windows version does return \n and no longer \r\n. So my fix at #73 no longer applies to the new version and does indeed break it. System.getProperty("line.separator") does still return \r\n and since mercurial now only appends \n we do strip too much - 2 instead of 1 character.

Changed 5 months ago by Sebastian

This one seems to fix it (at least i can commit now).

diff -r f0de39967c20 src/com/vectrace/MercurialEclipse/team/ActionCommit.java
--- a/src/com/vectrace/MercurialEclipse/team/ActionCommit.java	Fri Mar 28 23:13:53 2008 +0100
+++ b/src/com/vectrace/MercurialEclipse/team/ActionCommit.java	Sat Mar 29 15:08:34 2008 +0100
@@ -183,7 +183,12 @@
                 try
                 {
                   repository = MercurialUtilities.ExecuteCommand(getRootCmd,getRootWorkingDir,true);
-                  workingDir=new File(repository.substring(0,repository.length() - eol.length() ));
+                  if (repository.endsWith(eol)) {
+                	  workingDir=new File(repository.substring(0,repository.length() - eol.length() ));
+                  } else {
+                	  // assume it ends with '\n'
+                	  workingDir=new File(repository.substring(0,repository.length() - 1 ));
+                  }
                 }
                 catch(HgException e)
                 {

Changed 5 months ago by Sebastian

And one more to fix the status of files in the commit dialog (else all but first file don't have a correct status)

diff -r f0de39967c20 src/com/vectrace/MercurialEclipse/dialogs/CommitResourceUtil.java
--- a/src/com/vectrace/MercurialEclipse/dialogs/CommitResourceUtil.java	Fri Mar 28 23:13:53 2008 +0100
+++ b/src/com/vectrace/MercurialEclipse/dialogs/CommitResourceUtil.java	Sat Mar 29 15:30:48 2008 +0100
@@ -153,6 +153,10 @@
 			{
 				status = status.substring(eol.length());
 			}
+			if (status.startsWith("\n"))
+			{
+				status = status.substring(1);
+			}
 			if (fileName.startsWith(" "))
 			{
 				fileName = fileName.substring(1);

Changed 5 months ago by zingo

  • status changed from new to closed
  • resolution set to fixed

Thanx I incoperated the change.

Note: See TracTickets for help on using tickets.