diff options
author | Tomasz Zarna | 2011-02-15 10:00:21 +0000 |
---|---|---|
committer | Tomasz Zarna | 2011-02-15 10:00:21 +0000 |
commit | e219d855895c2745ceddcb2fd2fb5020669ad855 (patch) | |
tree | a25ec76ad3c46edfef8332f2d6eee6233c0a765f /bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal | |
parent | 35fed02fd4f31f676e66605f385fa895e75f9d25 (diff) | |
download | eclipse.platform.team-e219d855895c2745ceddcb2fd2fb5020669ad855.tar.gz eclipse.platform.team-e219d855895c2745ceddcb2fd2fb5020669ad855.tar.xz eclipse.platform.team-e219d855895c2745ceddcb2fd2fb5020669ad855.zip |
bug 76386: [History View] CVS Resource History shows revisions from all branches -- reverted, legal approval required
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal')
7 files changed, 30 insertions, 109 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java index becaab7ba..d41fa8235 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006 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 @@ -7,19 +7,17 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Olexiy Buyanskyy <olexiyb@gmail.com> - Bug 76386 - [History View] CVS Resource History shows revisions from all branches *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; import java.util.Date; + import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.team.core.history.ITag; import org.eclipse.team.internal.ccvs.core.filehistory.CVSFileRevision; import org.eclipse.team.internal.ui.history.AbstractHistoryCategory; public class CVSHistoryFilter extends ViewerFilter { - public String branchName; public String author; public Date fromDate; public Date toDate; @@ -27,8 +25,7 @@ public class CVSHistoryFilter extends ViewerFilter { public boolean isOr; private int matchCounter; - public CVSHistoryFilter(String branchName, String author, String comment, Date fromDate, Date toDate, boolean isOr) { - this.branchName = branchName; + public CVSHistoryFilter(String author, String comment, Date fromDate, Date toDate, boolean isOr) { this.author = author; this.comment = comment; this.fromDate = fromDate; @@ -48,7 +45,7 @@ public class CVSHistoryFilter extends ViewerFilter { CVSFileRevision entry = (CVSFileRevision) element; if (isOr) { //empty fields should be considered a non-match - boolean orSearch = (hasBranchName() && branchMatch(entry)) || (hasAuthor() && authorMatch(entry)) || (hasDate() && dateMatch(entry)) || (hasComment() && commentMatch(entry)); + boolean orSearch = (hasAuthor() && authorMatch(entry)) || (hasDate() && dateMatch(entry)) || (hasComment() && commentMatch(entry)); if (orSearch) matchCounter++; @@ -56,7 +53,7 @@ public class CVSHistoryFilter extends ViewerFilter { } else { //"and" search //empty fields should be considered a match - boolean andSearch = (!hasBranchName() || branchMatch(entry)) && (!hasAuthor() || authorMatch(entry)) && (!hasDate() || dateMatch(entry)) && (!hasComment() || commentMatch(entry)); + boolean andSearch = (!hasAuthor() || authorMatch(entry)) && (!hasDate() || dateMatch(entry)) && (!hasComment() || commentMatch(entry)); if (andSearch) matchCounter++; @@ -66,17 +63,6 @@ public class CVSHistoryFilter extends ViewerFilter { return false; } - protected boolean branchMatch(CVSFileRevision revision) { - ITag[] branches = revision.getBranches(); - for (int i = 0; i < branches.length; i++) { - String tag = branches[i].getName().toLowerCase(); - if ((tag.indexOf(branchName.toLowerCase()) != -1)) { - return true; - } - } - return false; - } - protected boolean authorMatch(CVSFileRevision revision) { return revision.getAuthor().equals(author); } @@ -101,10 +87,6 @@ public class CVSHistoryFilter extends ViewerFilter { return (fromDate.before(new Date(revision.getTimestamp()))); } - protected boolean hasBranchName() { - return !branchName.equals(""); //$NON-NLS-1$ - } - protected boolean hasAuthor() { return !author.equals(""); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java index 6b18ce39b..062ec118b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryFilterDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2008 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 @@ -7,7 +7,6 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Olexiy Buyanskyy <olexiyb@gmail.com> - Bug 76386 - [History View] CVS Resource History shows revisions from all branches *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; @@ -30,7 +29,6 @@ public class CVSHistoryFilterDialog extends TrayDialog { //widgets private Button orRadio; private Button andRadio; - private Text branchName; private Text author; private Text comment; private DateTime fromDate; @@ -73,12 +71,6 @@ public class CVSHistoryFilterDialog extends TrayDialog { data.horizontalSpan = 2; orRadio.setLayoutData(data); - //branch name -// label = new Label(topLevel, SWT.NONE); -// label.setText(CVSUIMessages.HistoryFilterDialog_branchname); -// branchName = new Text(topLevel, SWT.BORDER); -// branchName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - //author label = new Label(topLevel, SWT.NONE); label.setText(CVSUIMessages.HistoryFilterDialog_author); @@ -112,9 +104,6 @@ public class CVSHistoryFilterDialog extends TrayDialog { void initializeValues() { if (historyFilter == null) return; - if (historyFilter.branchName != null) { - branchName.setText(historyFilter.branchName); - } if (historyFilter.author != null) { author.setText(historyFilter.author); } @@ -150,7 +139,7 @@ public class CVSHistoryFilterDialog extends TrayDialog { Date toDate = getToDate(); //create the filter - historyFilter = new CVSHistoryFilter(branchName.getText(), author.getText(), comment.getText(), fromDate, toDate, orRadio.getSelection()); + historyFilter = new CVSHistoryFilter(author.getText(), comment.getText(), fromDate, toDate, orRadio.getSelection()); super.buttonPressed(buttonId); } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java index e5284fe28..6947c6ac9 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java @@ -9,7 +9,6 @@ * IBM Corporation - initial API and implementation * Eugene Kuleshov <eu@md.pp.ru> - Bug 153932 [History] Custom hyperlink detectors for comments in History view * Brock Janiczak (brockj@tpg.com.au) - Bug 181899 CVS History wrongly ordered - * Olexiy Buyanskyy <olexiyb@gmail.com> - Bug 76386 - [History View] CVS Resource History shows revisions from all branches *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; @@ -1607,7 +1606,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC //Update the history (if it exists) to reflect the new //counts if (historyFilter != null){ - CVSHistoryFilter tempFilter = new CVSHistoryFilter(historyFilter.branchName, historyFilter.author, historyFilter.comment, historyFilter.fromDate, historyFilter.toDate, historyFilter.isOr); + CVSHistoryFilter tempFilter = new CVSHistoryFilter(historyFilter.author, historyFilter.comment, historyFilter.fromDate, historyFilter.toDate, historyFilter.isOr); showFilter(tempFilter); } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistorySearchFilter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistorySearchFilter.java index fe1f772ed..661fed6ef 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistorySearchFilter.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistorySearchFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006 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 @@ -7,7 +7,6 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Olexiy Buyanskyy <olexiyb@gmail.com> - Bug 76386 - [History View] CVS Resource History shows revisions from all branches *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; @@ -45,7 +44,7 @@ public class CVSHistorySearchFilter extends org.eclipse.jface.viewers.ViewerFilt CVSFileRevision entry = (CVSFileRevision) element; //empty fields should be considered a non-match - boolean orSearch = (authorMatch(entry)) || (dateMatch(entry)) || (commentMatch(entry) || revisionMatch(entry) || tagMatch(entry) || branchNameMatch(entry)); + boolean orSearch = (authorMatch(entry)) || (dateMatch(entry)) || (commentMatch(entry) || revisionMatch(entry) || tagMatch(entry)); if (orSearch) matchCounter++; return orSearch; @@ -89,20 +88,7 @@ public class CVSHistorySearchFilter extends org.eclipse.jface.viewers.ViewerFilt return false; } - - protected boolean branchNameMatch(CVSFileRevision revision) { - ITag[] branches = revision.getBranches(); - for (int i = 0; i < branches.length; i++) { - String tag = branches[i].getName().toLowerCase(); - Iterator iter = searchStrings.iterator(); - while (iter.hasNext()) { - if (!(tag.indexOf(((String) iter.next()).toLowerCase()) == -1)) - return true; - } - } - return false; - } - + protected boolean tagMatch(CVSFileRevision revision) { ITag[] tags = revision.getTags(); for (int i = 0; i < tags.length; i++) { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java index 0cb366a2a..dee1c2540 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2009 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 @@ -9,7 +9,6 @@ * IBM - Initial API and implementation * Maik Schreiber - bug 102461 * Philippe Ombredanne - bug 84808 - * Olexiy Buyanskyy <olexiyb@gmail.com> - Bug 76386 - [History View] CVS Resource History shows revisions from all branches *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; @@ -436,7 +435,6 @@ public class CVSUIMessages extends NLS { public static String HistoryFilterDialog_showMatching; public static String HistoryFilterDialog_matchingAny; public static String HistoryFilterDialog_matchingAll; - public static String HistoryFilterDialog_branchname; public static String HistoryFilterDialog_author; public static String HistoryFilterDialog_comment; public static String HistoryFilterDialog_fromDate; @@ -447,7 +445,6 @@ public class CVSUIMessages extends NLS { public static String HistoryView_tagWithExistingAction; public static String HistoryView_copy; public static String HistoryView_revision; - public static String HistoryView_branches; public static String HistoryView_tags; public static String HistoryView_date; public static String HistoryView_author; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java index c78f69003..dfdeefbf2 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryTableProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2006 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 @@ -7,7 +7,6 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Olexiy Buyanskyy <olexiyb@gmail.com> - Bug 76386 - [History View] CVS Resource History shows revisions from all branches *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui; @@ -46,11 +45,10 @@ public class HistoryTableProvider { //column constants private static final int COL_REVISION = 0; - private static final int COL_BRANCHES = 1; - private static final int COL_TAGS = 2; - private static final int COL_DATE = 3; - private static final int COL_AUTHOR = 4; - private static final int COL_COMMENT = 5; + private static final int COL_TAGS = 1; + private static final int COL_DATE = 2; + private static final int COL_AUTHOR = 3; + private static final int COL_COMMENT = 4; /** * The history label provider. @@ -71,19 +69,9 @@ public class HistoryTableProvider { revision = NLS.bind(CVSUIMessages.currentRevision, new String[] { revision }); } return revision; - case COL_BRANCHES: - CVSTag[] branches = entry.getBranches(); - StringBuffer result = new StringBuffer(); - for (int i = 0; i < branches.length; i++) { - result.append(branches[i].getName()); - if (i < branches.length - 1) { - result.append(", "); //$NON-NLS-1$ - } - } - return result.toString(); case COL_TAGS: CVSTag[] tags = entry.getTags(); - result = new StringBuffer(); + StringBuffer result = new StringBuffer(); for (int i = 0; i < tags.length; i++) { result.append(tags[i].getName()); if (i < tags.length - 1) { @@ -169,14 +157,13 @@ public class HistoryTableProvider { private VersionCollator versionCollator = new VersionCollator(); - // column headings: "Revision" "Branches" "Tags" "Date" "Author" "Comment" + // column headings: "Revision" "Tags" "Date" "Author" "Comment" private int[][] SORT_ORDERS_BY_COLUMN = { - {COL_REVISION, COL_DATE, COL_AUTHOR, COL_COMMENT, COL_TAGS, COL_BRANCHES}, /* revision */ - {COL_BRANCHES, COL_REVISION, COL_DATE, COL_AUTHOR, COL_COMMENT, COL_TAGS}, /* tags */ - {COL_TAGS, COL_REVISION, COL_DATE, COL_AUTHOR, COL_COMMENT, COL_BRANCHES}, /* tags */ - {COL_DATE, COL_REVISION, COL_AUTHOR, COL_COMMENT, COL_TAGS, COL_BRANCHES}, /* date */ - {COL_AUTHOR, COL_REVISION, COL_DATE, COL_COMMENT, COL_TAGS, COL_BRANCHES}, /* author */ - {COL_COMMENT, COL_REVISION, COL_DATE, COL_AUTHOR, COL_TAGS, COL_BRANCHES} /* comment */ + {COL_REVISION, COL_DATE, COL_AUTHOR, COL_COMMENT, COL_TAGS}, /* revision */ + {COL_TAGS, COL_REVISION, COL_DATE, COL_AUTHOR, COL_COMMENT}, /* tags */ + {COL_DATE, COL_REVISION, COL_AUTHOR, COL_COMMENT, COL_TAGS}, /* date */ + {COL_AUTHOR, COL_REVISION, COL_DATE, COL_COMMENT, COL_TAGS}, /* author */ + {COL_COMMENT, COL_REVISION, COL_DATE, COL_AUTHOR, COL_TAGS} /* comment */ }; /** @@ -212,19 +199,9 @@ public class HistoryTableProvider { */ int compareColumnValue(int columnNumber, ILogEntry e1, ILogEntry e2) { switch (columnNumber) { - case COL_REVISION: /* revision */ + case 0: /* revision */ return versionCollator.compare(e1.getRevision(), e2.getRevision()); - case COL_BRANCHES: /* branches */ - CVSTag[] branches1 = e1.getBranches(); - CVSTag[] branches2 = e2.getBranches(); - if (branches2.length == 0) { - return -1; - } - if (branches1.length == 0) { - return 1; - } - return getComparator().compare(branches1[0].getName(), branches2[0].getName()); - case COL_TAGS: /* tags */ + case 1: /* tags */ CVSTag[] tags1 = e1.getTags(); CVSTag[] tags2 = e2.getTags(); if (tags2.length == 0) { @@ -234,13 +211,13 @@ public class HistoryTableProvider { return 1; } return getComparator().compare(tags1[0].getName(), tags2[0].getName()); - case COL_DATE: /* date */ + case 2: /* date */ Date date1 = e1.getDate(); Date date2 = e2.getDate(); return date1.compareTo(date2); - case COL_AUTHOR: /* author */ + case 3: /* author */ return getComparator().compare(e1.getAuthor(), e2.getAuthor()); - case COL_COMMENT: /* comment */ + case 4: /* comment */ return getComparator().compare(e1.getComment(), e2.getComment()); default: return 0; @@ -370,13 +347,6 @@ public class HistoryTableProvider { col.addSelectionListener(headerListener); layout.addColumnData(new ColumnWeightData(20, true)); - // branches - col = new TableColumn(table, SWT.NONE); - col.setResizable(true); - col.setText(CVSUIMessages.HistoryView_branches); - col.addSelectionListener(headerListener); - layout.addColumnData(new ColumnWeightData(20, true)); - // tags col = new TableColumn(table, SWT.NONE); col.setResizable(true); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index 4ccfe9709..dbcf8986e 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2011 IBM Corporation and others. +# Copyright (c) 2000, 2010 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 @@ -382,7 +382,6 @@ HistoryFilterDialog_title = Filter Resource History HistoryFilterDialog_showMatching = Show entries matching: HistoryFilterDialog_matchingAny = a&ny of the provided criteria HistoryFilterDialog_matchingAll = a&ll of the provided criteria -HistoryFilterDialog_branchname = &Branch name: HistoryFilterDialog_author = &Author: HistoryFilterDialog_comment = &Comment containing: HistoryFilterDialog_fromDate = &From date: @@ -393,7 +392,6 @@ HistoryView_getRevisionAction=Get Sticky &Revision HistoryView_tagWithExistingAction=&Tag with Existing... HistoryView_copy=&Copy HistoryView_revision=Revision -HistoryView_branches=Branches HistoryView_tags=Tags HistoryView_date=Date HistoryView_author=Author |