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 28126 Details for
Bug 112169
[Apply Patch] Exception applying a patch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for preventing the checking of diffs with problems in Apply Patch
workspacepatcher-ApplyPatchDisableTreeChecking.patch (text/plain), 4.06 KB, created by
Bogdan Gheorghe
on 2005-10-11 14:20:19 EDT
(
hide
)
Description:
Patch for preventing the checking of diffs with problems in Apply Patch
Filename:
MIME Type:
Creator:
Bogdan Gheorghe
Created:
2005-10-11 14:20:19 EDT
Size:
4.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.compare >Index: compare/org/eclipse/compare/internal/patch/Hunk.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Hunk.java,v >retrieving revision 1.11 >diff -u -r1.11 Hunk.java >--- compare/org/eclipse/compare/internal/patch/Hunk.java 6 Oct 2005 17:18:00 -0000 1.11 >+++ compare/org/eclipse/compare/internal/patch/Hunk.java 11 Oct 2005 18:17:40 -0000 >@@ -165,4 +165,8 @@ > return this; > return null; > } >+ >+ protected boolean getHunkProblem() { >+ return fHunkProblem; >+ } > } >Index: compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java,v >retrieving revision 1.30 >diff -u -r1.30 PreviewPatchPage.java >--- compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java 6 Oct 2005 17:18:00 -0000 1.30 >+++ compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java 11 Oct 2005 18:17:40 -0000 >@@ -338,11 +338,31 @@ > DiffProject proj = null; > if (obj instanceof DiffProject){ > proj = (DiffProject) obj; >+ //Check to see if any of the Diffs contained by the DiffProject >+ //have their diff problems set >+ Object[] diffs = proj.getChildren(null); >+ for (int i= 0; i<diffs.length; i++) { >+ if (((Diff) diffs[i]).containsProblems()){ >+ checked.setChecked(obj, false); >+ break; >+ } >+ } > } else if (obj instanceof Diff){ > proj = ((Diff) obj).getProject(); >+ //If Diff has any diff problems set, at least one hunk underneath >+ //does not match - so don't allow entire tree to be checked >+ if (((Diff) obj).containsProblems()){ >+ checked.setChecked(obj, false); >+ } > } else if (obj instanceof Hunk){ > Diff diff = (Diff) ((Hunk) obj).getParent(null); > proj = diff.getProject(); >+ //Check to see if this hunk has any problems OR >+ //if its parent has any problems >+ if( diff.getDiffProblem() || >+ ((Hunk) obj).getHunkProblem()){ >+ checked.setChecked(obj, false); >+ } > } > if (proj!= null && > !proj.getProject().exists()){ >@@ -359,7 +379,7 @@ > Object obj= sel.getFirstElement(); > > if (obj instanceof Hunk) { >- PreviewPatchPage.this.fHunkViewer.setInput(createInput((Hunk) obj)); >+ PreviewPatchPage.this.fHunkViewer.setInput(createInput((Hunk) obj)); > } else > PreviewPatchPage.this.fHunkViewer.setInput(null); > >Index: compare/org/eclipse/compare/internal/patch/Diff.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Diff.java,v >retrieving revision 1.10 >diff -u -r1.10 Diff.java >--- compare/org/eclipse/compare/internal/patch/Diff.java 6 Oct 2005 17:18:00 -0000 1.10 >+++ compare/org/eclipse/compare/internal/patch/Diff.java 11 Oct 2005 18:17:40 -0000 >@@ -159,7 +159,9 @@ > if (hunkFailed) > this.fMatches= false; > hunk.reset(hunkFailed); >- if (!hunkFailed && projectExistsInWorkspace) >+ //If the hunk can be applied and the project exists in the workspace and >+ //there are no problems with the hunk's containing diff, then check the hunk >+ if (!hunkFailed && projectExistsInWorkspace && !fDiffProblem) > hunksToCheck.add(hunk); > } > return hunksToCheck; >@@ -253,5 +255,27 @@ > return null; > } > >+ protected boolean getDiffProblem() { >+ return fDiffProblem; >+ } >+ >+ /** >+ * Returns whether this Diff has any problems >+ * @return true if this Diff or any of its children Hunks have a problem, false if it doesn't >+ */ >+ protected boolean containsProblems(){ >+ >+ if (fDiffProblem) >+ return true; >+ >+ for (Iterator iter= fHunks.iterator(); iter.hasNext();) { >+ Hunk element= (Hunk) iter.next(); >+ if (element.getHunkProblem()){ >+ return true; >+ } >+ } >+ return false; >+ } >+ > } >
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 112169
: 28126