Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 191620 Details for
Bug 319661
Patch wizard excludes changes in projects that it can't connect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix with test
patch_319661_withTest_corrected1.txt (text/plain), 9.97 KB, created by
Malgorzata Janczarska
on 2011-03-21 11:44:13 EDT
(
hide
)
Description:
Fix with test
Filename:
MIME Type:
Creator:
Malgorzata Janczarska
Created:
2011-03-21 11:44:13 EDT
Size:
9.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.core >Index: src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java,v >retrieving revision 1.18 >diff -u -r1.18 DiffListener.java >--- src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java 24 Apr 2009 09:33:21 -0000 1.18 >+++ src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java 21 Mar 2011 15:30:24 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -74,10 +74,10 @@ > ICVSRepositoryLocation location, > ICVSFolder commandRoot, > IProgressMonitor monitor) { >- // ignore server messages for now - this is used only with the diff >- // request and the errors can be safely ignored. >+ // return all the server errors as CVSStatus.ERROR_LINE or >+ // CVSStatus.PROTOCOL_ERROR > if (getServerMessage(line, location) != null) { >- return OK; >+ return super.errorLine(line, location, commandRoot, monitor); > } > > //Check to see if this is a no such directory message >Index: src/org/eclipse/team/internal/ccvs/core/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties,v >retrieving revision 1.174 >diff -u -r1.174 messages.properties >--- src/org/eclipse/team/internal/ccvs/core/messages.properties 15 Feb 2011 10:00:21 -0000 1.174 >+++ src/org/eclipse/team/internal/ccvs/core/messages.properties 21 Mar 2011 15:30:24 -0000 >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2000, 2009 IBM Corporation and others. >+# Copyright (c) 2000, 2011 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -261,4 +261,4 @@ > PrepareForReplaceVisitor_DeletedFileWithoutHistoryCannotBeRestoredWhileRevertToBase=Deleted file does not have history and cannot be restored with BASE tag. > PrepareForReplaceVisitor_FileCannotBeReplacedWithBase=File {0} cannot be replaced with BASE. > ThePatchDoesNotContainChangesFor_0= The patch does not contain changes for {0} >-ThePatchDoesNotContainAllTheChanges=The patch does not contain all the changes >\ No newline at end of file >+ThePatchDoesNotContainAllTheChanges=An error occurred while performing CVS diff operation, the patch may not contain all the changes >\ No newline at end of file >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java,v >retrieving revision 1.19 >diff -u -r1.19 DiffOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java 21 Sep 2009 10:40:45 -0000 1.19 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java 21 Mar 2011 15:30:25 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2009 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -312,7 +312,10 @@ > List toShow = new ArrayList(); > IStatus children[] = status.getChildren(); > for (int i = 0; i < children.length; i++) { >- if (children[i].getCode() == CVSStatus.BINARY_FILES_DIFFER) { >+ // ignore all errors except those found by DiffListener >+ if (children[i].getCode() == CVSStatus.BINARY_FILES_DIFFER >+ || children[i].getCode() == CVSStatus.PROTOCOL_ERROR >+ || children[i].getCode() == CVSStatus.ERROR_LINE) { > toShow.add(children[i]); > } > } >#P org.eclipse.team.tests.cvs.core >Index: patchdata/server_response_with_error.txt >=================================================================== >RCS file: patchdata/server_response_with_error.txt >diff -N patchdata/server_response_with_error.txt >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ patchdata/server_response_with_error.txt 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+M Index: src/Test1.java >+M =================================================================== >+M RCS file: /Eclipse_home/CVSREPO/test/src/Test1.java,v >+M retrieving revision 1.1 >+M diff -u -r1.1 Test1.java >+M --- src/Test1.java 31 Jan 2011 16:19:33 -0000 1.1 >+M +++ src/Test1.java 31 Jan 2011 17:48:38 -0000 >+M @@ -1,4 +1,6 @@ >+M >+M public class Test1 { >+M + private void testMethod1() { >+M >+M + } >+M } >+E cvs server: cannot find revision control file for src/Test2.java >+error >\ No newline at end of file >Index: src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java,v >retrieving revision 1.2 >diff -u -r1.2 CreatePatchTest.java >--- src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java 25 Feb 2010 10:22:34 -0000 1.2 >+++ src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java 21 Mar 2011 15:30:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2009, 2010 IBM Corporation and others. >+ * Copyright (c) 2009, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,9 +11,12 @@ > package org.eclipse.team.tests.ccvs.ui; > > import java.io.BufferedReader; >+import java.io.FileNotFoundException; >+import java.io.FileOutputStream; > import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; >+import java.io.PrintStream; > import java.net.URL; > > import junit.framework.Test; >@@ -26,7 +29,9 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Path; >+import org.eclipse.core.runtime.Status; > import org.eclipse.jface.wizard.IWizardPage; > import org.eclipse.jface.wizard.WizardDialog; > import org.eclipse.swt.SWT; >@@ -35,6 +40,12 @@ > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Text; >+import org.eclipse.team.internal.ccvs.core.CVSException; >+import org.eclipse.team.internal.ccvs.core.CVSStatus; >+import org.eclipse.team.internal.ccvs.core.ICVSFolder; >+import org.eclipse.team.internal.ccvs.core.client.Command; >+import org.eclipse.team.internal.ccvs.core.client.Session; >+import org.eclipse.team.internal.ccvs.core.client.listeners.DiffListener; > import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; > import org.eclipse.team.internal.ccvs.ui.wizards.GenerateDiffFileWizard; > import org.eclipse.team.tests.ccvs.core.EclipseTest; >@@ -279,4 +290,81 @@ > return event; > } > >+ public void testBug31661() throws FileNotFoundException, CoreException { >+ >+ Session session = new Session(getRepository(), >+ (ICVSFolder) getCVSResource(testProject)) { >+ // Override the session so it always returns response with an error. >+ private BufferedReader serverResp = new BufferedReader( >+ new InputStreamReader( >+ asInputStream("server_response_with_error.txt"))); >+ >+ private boolean isOpened = false; >+ >+ public void open(IProgressMonitor monitor) throws CVSException { >+ super.open(monitor); >+ isOpened = true; >+ } >+ >+ public String readLine() throws CVSException { >+ if (!isOpened) { >+ return super.readLine(); >+ } >+ try { >+ return serverResp.readLine(); >+ } catch (IOException e) { >+ throw new CVSException(new Status(IStatus.ERROR, null, >+ null, e)); >+ } >+ } >+ >+ public void close() { >+ try { >+ super.close(); >+ serverResp.close(); >+ } catch (IOException e) { >+ fail(e.getMessage()); >+ } >+ } >+ }; >+ >+ PrintStream stream = new PrintStream(new FileOutputStream(testProject >+ .getFile("/patch_with_error.txt").getLocation().toFile())); >+ >+ try { >+ session.open(getMonitor()); >+ >+ DiffListener diffListener = new DiffListener(stream); >+ >+ IStatus status = Command.DIFF.execute(session, >+ Command.NO_GLOBAL_OPTIONS, new Command.LocalOption[0], >+ new String[0], diffListener, getMonitor()); >+ >+ assertNotNull( >+ "Diff command did not report error when some changes were excluded", >+ status); >+ assertEquals("Diff command did not report server error", >+ CVSStatus.SERVER_ERROR, status.getCode()); >+ >+ IStatus children[] = status.getChildren(); >+ assertTrue("Diff command did not report any server errors", >+ children.length > 0); >+ >+ boolean errorLineOccurred = false; >+ for (int i = 0; i < children.length; i++) { >+ if (children[i].getCode() == CVSStatus.ERROR_LINE) { >+ errorLineOccurred = true; >+ break; >+ } >+ } >+ >+ assertTrue("Diff command did not report error line", >+ errorLineOccurred); >+ >+ } finally { >+ session.close(); >+ stream.close(); >+ } >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 319661
:
174117
|
174118
|
179729
|
181164
|
182398
|
188030
|
188902
|
191620
|
191691
|
191747
|
191748
|
191749
|
192352
|
192455
|
192525
|
193008
|
193808
|
193909