This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 235882
Collapse All | Expand All

(-)a/git/nbproject/project.xml (-1 / +1 lines)
Lines 20-26 Link Here
20
                    <compile-dependency/>
20
                    <compile-dependency/>
21
                    <run-dependency>
21
                    <run-dependency>
22
                        <release-version>1</release-version>
22
                        <release-version>1</release-version>
23
                        <specification-version>1.12</specification-version>
23
                        <specification-version>1.14</specification-version>
24
                    </run-dependency>
24
                    </run-dependency>
25
                </dependency>
25
                </dependency>
26
                <dependency>
26
                <dependency>
(-)a/git/src/org/netbeans/modules/git/HistoryRegistry.java (-1 / +1 lines)
Lines 87-93 Link Here
87
        crit.setFollowRenames(true);
87
        crit.setFollowRenames(true);
88
        crit.setIncludeMerges(false);
88
        crit.setIncludeMerges(false);
89
        try {
89
        try {
90
            GitRevisionInfo[] history = client.log(crit, pm);
90
            GitRevisionInfo[] history = client.log(crit, false, pm);
91
            if (!pm.isCanceled() && history.length > 0) {
91
            if (!pm.isCanceled() && history.length > 0) {
92
                for (File f : files) {
92
                for (File f : files) {
93
                    logs.put(f, Arrays.asList(history));
93
                    logs.put(f, Arrays.asList(history));
(-)a/git/src/org/netbeans/modules/git/client/GitClient.java (-3 / +4 lines)
Lines 95-101 Link Here
95
    private final boolean handleAuthenticationIssues;
95
    private final boolean handleAuthenticationIssues;
96
    private static final int CLEANUP_TIME = 15000;
96
    private static final int CLEANUP_TIME = 15000;
97
    private static final List<org.netbeans.libs.git.GitClient> unusedClients = new LinkedList<org.netbeans.libs.git.GitClient>();
97
    private static final List<org.netbeans.libs.git.GitClient> unusedClients = new LinkedList<org.netbeans.libs.git.GitClient>();
98
    private static RequestProcessor.Task cleanTask = Git.getInstance().getRequestProcessor().create(new CleanTask());
98
    private static final RequestProcessor.Task cleanTask = Git.getInstance().getRequestProcessor().create(new CleanTask());
99
    
99
    
100
    /**
100
    /**
101
     * Set of commands that do not need to run under repository lock
101
     * Set of commands that do not need to run under repository lock
Lines 564-575 Link Here
564
        }, "log"); //NOI18N
564
        }, "log"); //NOI18N
565
    }
565
    }
566
566
567
    public GitRevisionInfo[] log (final SearchCriteria searchCriteria, final ProgressMonitor monitor) throws GitException.MissingObjectException, GitException {
567
    public GitRevisionInfo[] log (final SearchCriteria searchCriteria, final boolean fetchAffectedBranches,
568
            final ProgressMonitor monitor) throws GitException.MissingObjectException, GitException {
568
        return new CommandInvoker().runMethod(new Callable<GitRevisionInfo[]>() {
569
        return new CommandInvoker().runMethod(new Callable<GitRevisionInfo[]>() {
569
570
570
            @Override
571
            @Override
571
            public GitRevisionInfo[] call () throws Exception {
572
            public GitRevisionInfo[] call () throws Exception {
572
                return delegate.log(searchCriteria, monitor);
573
                return delegate.log(searchCriteria, fetchAffectedBranches, monitor);
573
            }
574
            }
574
        }, "log"); //NOI18N
575
        }, "log"); //NOI18N
575
    }
576
    }
(-)a/git/src/org/netbeans/modules/git/ui/history/Bundle.properties (+2 lines)
Lines 152-154 Link Here
152
TT_Branch=Find only commits from a specific branch. Leave blank to see commits from all branches.
152
TT_Branch=Find only commits from a specific branch. Leave blank to see commits from all branches.
153
SearchCriteriaPanel.btnSelectBranch.TTtext=Select branch you wish to search
153
SearchCriteriaPanel.btnSelectBranch.TTtext=Select branch you wish to search
154
SearchCriteriaPanel.btnSelectBranch.text=...
154
SearchCriteriaPanel.btnSelectBranch.text=...
155
branchLabel.text=&Branch:
156
branchLabel.TTtext=Select a branch to show only commits being part of the branch
(-)a/git/src/org/netbeans/modules/git/ui/history/SearchExecutor.java (-1 / +1 lines)
Lines 152-158 Link Here
152
    List<RepositoryRevision> search (int limit, GitClient client, ProgressMonitor monitor) throws GitException {
152
    List<RepositoryRevision> search (int limit, GitClient client, ProgressMonitor monitor) throws GitException {
153
        sc.setLimit(limit);
153
        sc.setLimit(limit);
154
        List<RepositoryRevision> retval = Collections.<RepositoryRevision>emptyList();
154
        List<RepositoryRevision> retval = Collections.<RepositoryRevision>emptyList();
155
        GitRevisionInfo[] messages = client.log(sc, monitor);
155
        GitRevisionInfo[] messages = client.log(sc, true, monitor);
156
        if (!monitor.isCanceled()) {
156
        if (!monitor.isCanceled()) {
157
            RepositoryInfo info = RepositoryInfo.getInstance(getRepositoryRoot());
157
            RepositoryInfo info = RepositoryInfo.getInstance(getRepositoryRoot());
158
            retval = appendResults(messages, info.getBranches().values(), info.getTags().values(), monitor);
158
            retval = appendResults(messages, info.getBranches().values(), info.getTags().values(), monitor);
(-)a/git/src/org/netbeans/modules/git/ui/history/SearchHistoryAction.java (-3 / +6 lines)
Lines 79-88 Link Here
79
    public static void openSearch(final File repository, final File[] roots, final String contextName) {
79
    public static void openSearch(final File repository, final File[] roots, final String contextName) {
80
        final String title = NbBundle.getMessage(SearchHistoryTopComponent.class, "LBL_SearchHistoryTopComponent.title", contextName);
80
        final String title = NbBundle.getMessage(SearchHistoryTopComponent.class, "LBL_SearchHistoryTopComponent.title", contextName);
81
        final String activeBranch = getActiveBranchName(repository);
81
        final String activeBranch = getActiveBranchName(repository);
82
        final RepositoryInfo info = RepositoryInfo.getInstance(repository);
82
        EventQueue.invokeLater(new Runnable() {
83
        EventQueue.invokeLater(new Runnable() {
83
            @Override
84
            @Override
84
            public void run () {
85
            public void run () {
85
                SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repository, roots);
86
                SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repository, info, roots);
86
                tc.setBranch(activeBranch);
87
                tc.setBranch(activeBranch);
87
                tc.setDisplayName(title);
88
                tc.setDisplayName(title);
88
                tc.open();
89
                tc.open();
Lines 96-105 Link Here
96
    
97
    
97
    public static void openSearch (final File repository, final File root, final String contextName, final String commitId) {
98
    public static void openSearch (final File repository, final File root, final String contextName, final String commitId) {
98
        final String title = NbBundle.getMessage(SearchHistoryTopComponent.class, "LBL_SearchHistoryTopComponent.title", contextName);
99
        final String title = NbBundle.getMessage(SearchHistoryTopComponent.class, "LBL_SearchHistoryTopComponent.title", contextName);
100
        final RepositoryInfo info = RepositoryInfo.getInstance(repository);
99
        Mutex.EVENT.readAccess(new Runnable() {
101
        Mutex.EVENT.readAccess(new Runnable() {
100
            @Override
102
            @Override
101
            public void run () {
103
            public void run () {
102
                SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repository, new File[] { root });
104
                SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repository, info, new File[] { root });
103
                tc.setDisplayName(title);
105
                tc.setDisplayName(title);
104
                tc.open();
106
                tc.open();
105
                tc.requestActive();
107
                tc.requestActive();
Lines 111-120 Link Here
111
    
113
    
112
    public static void openSearch (final File repository, final File root, final String contextName, final int lineNumber) {
114
    public static void openSearch (final File repository, final File root, final String contextName, final int lineNumber) {
113
        final String title = NbBundle.getMessage(SearchHistoryTopComponent.class, "LBL_SearchHistoryTopComponent.title", contextName);
115
        final String title = NbBundle.getMessage(SearchHistoryTopComponent.class, "LBL_SearchHistoryTopComponent.title", contextName);
116
        final RepositoryInfo info = RepositoryInfo.getInstance(repository);
114
        EventQueue.invokeLater(new Runnable() {
117
        EventQueue.invokeLater(new Runnable() {
115
            @Override
118
            @Override
116
            public void run () {
119
            public void run () {
117
                SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repository, root, new SearchHistoryTopComponent.DiffResultsViewFactory() {
120
                SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repository, info, root, new SearchHistoryTopComponent.DiffResultsViewFactory() {
118
                    @Override
121
                    @Override
119
                    DiffResultsView createDiffResultsView(SearchHistoryPanel panel, List<RepositoryRevision> results) {
122
                    DiffResultsView createDiffResultsView(SearchHistoryPanel panel, List<RepositoryRevision> results) {
120
                        return new DiffResultsViewForLine(panel, results, lineNumber);
123
                        return new DiffResultsViewForLine(panel, results, lineNumber);
(-)a/git/src/org/netbeans/modules/git/ui/history/SearchHistoryPanel.form (+30 lines)
Lines 180-185 Link Here
180
            <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="16"/>
180
            <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="16"/>
181
          </AuxValues>
181
          </AuxValues>
182
        </Component>
182
        </Component>
183
        <Component class="javax.swing.JToolBar$Separator" name="jSeparator4">
184
        </Component>
185
        <Component class="javax.swing.JLabel" name="lblBranch">
186
          <Properties>
187
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
188
              <ComponentRef name="cmbBranch"/>
189
            </Property>
190
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
191
              <ResourceString bundle="org/netbeans/modules/git/ui/history/Bundle.properties" key="branchLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
192
            </Property>
193
            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
194
              <ResourceString bundle="org/netbeans/modules/git/ui/history/Bundle.properties" key="branchLabel.TTtext" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
195
            </Property>
196
            <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
197
              <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
198
                <EmptyBorder bottom="0" left="5" right="5" top="0"/>
199
              </Border>
200
            </Property>
201
          </Properties>
202
        </Component>
203
        <Component class="javax.swing.JComboBox" name="cmbBranch">
204
          <Properties>
205
            <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
206
              <StringArray count="0"/>
207
            </Property>
208
          </Properties>
209
          <Events>
210
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmbBranchActionPerformed"/>
211
          </Events>
212
        </Component>
183
        <Component class="javax.swing.JToolBar$Separator" name="jSeparator1">
213
        <Component class="javax.swing.JToolBar$Separator" name="jSeparator1">
184
        </Component>
214
        </Component>
185
        <Component class="javax.swing.JLabel" name="lblFilter">
215
        <Component class="javax.swing.JLabel" name="lblFilter">
(-)a/git/src/org/netbeans/modules/git/ui/history/SearchHistoryPanel.java (-1 / +94 lines)
Lines 45-50 Link Here
45
package org.netbeans.modules.git.ui.history;
45
package org.netbeans.modules.git.ui.history;
46
46
47
import java.awt.Color;
47
import java.awt.Color;
48
import java.awt.Component;
48
import javax.swing.event.DocumentEvent;
49
import javax.swing.event.DocumentEvent;
49
import javax.swing.event.DocumentListener;
50
import javax.swing.event.DocumentListener;
50
import org.openide.util.NbBundle;
51
import org.openide.util.NbBundle;
Lines 73-80 Link Here
73
import javax.swing.AbstractAction;
74
import javax.swing.AbstractAction;
74
import javax.swing.Action;
75
import javax.swing.Action;
75
import javax.swing.BoxLayout;
76
import javax.swing.BoxLayout;
77
import javax.swing.ComboBoxModel;
76
import javax.swing.DefaultComboBoxModel;
78
import javax.swing.DefaultComboBoxModel;
79
import javax.swing.DefaultListCellRenderer;
77
import javax.swing.Icon;
80
import javax.swing.Icon;
81
import javax.swing.JList;
78
import javax.swing.KeyStroke;
82
import javax.swing.KeyStroke;
79
import javax.swing.SwingUtilities;
83
import javax.swing.SwingUtilities;
80
import javax.swing.Timer;
84
import javax.swing.Timer;
Lines 88-101 Link Here
88
import org.netbeans.modules.git.client.GitProgressSupport;
92
import org.netbeans.modules.git.client.GitProgressSupport;
89
import org.netbeans.modules.git.ui.history.SearchHistoryTopComponent.DiffResultsViewFactory;
93
import org.netbeans.modules.git.ui.history.SearchHistoryTopComponent.DiffResultsViewFactory;
90
import org.netbeans.modules.git.ui.history.SummaryView.GitLogEntry;
94
import org.netbeans.modules.git.ui.history.SummaryView.GitLogEntry;
95
import org.netbeans.modules.git.ui.repository.RepositoryInfo;
91
import org.netbeans.modules.versioning.history.AbstractSummaryView.SummaryViewMaster.SearchHighlight;
96
import org.netbeans.modules.versioning.history.AbstractSummaryView.SummaryViewMaster.SearchHighlight;
92
import org.netbeans.modules.versioning.util.VCSKenaiAccessor;
97
import org.netbeans.modules.versioning.util.VCSKenaiAccessor;
98
import org.openide.util.WeakListeners;
93
99
94
/**
100
/**
95
 * Contains all components of the Search History panel.
101
 * Contains all components of the Search History panel.
96
 *
102
 *
97
 * @author Maros Sandor
103
 * @author Maros Sandor
98
 */
104
 */
105
@NbBundle.Messages({
106
    "SearchHistoryPanel.filter.allbranches=All Branches"
107
})
99
class SearchHistoryPanel extends javax.swing.JPanel implements ExplorerManager.Provider, PropertyChangeListener, DocumentListener, ActionListener {
108
class SearchHistoryPanel extends javax.swing.JPanel implements ExplorerManager.Provider, PropertyChangeListener, DocumentListener, ActionListener {
100
109
101
    private final File[]                roots;
110
    private final File[]                roots;
Lines 124-129 Link Here
124
    private DiffResultsViewFactory diffViewFactory;
133
    private DiffResultsViewFactory diffViewFactory;
125
    private boolean searchStarted;
134
    private boolean searchStarted;
126
    private String currentBranch;
135
    private String currentBranch;
136
    private Object currentBranchFilter = ALL_BRANCHES_FILTER;
137
    private final RepositoryInfo info;
138
    private static final String ALL_BRANCHES_FILTER = Bundle.SearchHistoryPanel_filter_allbranches();
127
139
128
    enum FilterKind {
140
    enum FilterKind {
129
        ALL(null, NbBundle.getMessage(SearchHistoryPanel.class, "Filter.All")), //NOI18N
141
        ALL(null, NbBundle.getMessage(SearchHistoryPanel.class, "Filter.All")), //NOI18N
Lines 147-155 Link Here
147
    private final Timer filterTimer;
159
    private final Timer filterTimer;
148
160
149
    /** Creates new form SearchHistoryPanel */
161
    /** Creates new form SearchHistoryPanel */
150
    public SearchHistoryPanel(File repository, File [] roots, SearchCriteriaPanel criteria) {
162
    public SearchHistoryPanel(File repository, RepositoryInfo info, File [] roots, SearchCriteriaPanel criteria) {
151
        this.roots = roots;
163
        this.roots = roots;
152
        this.repository = repository;
164
        this.repository = repository;
165
        this.info = info;
153
        this.criteria = criteria;
166
        this.criteria = criteria;
154
        this.diffViewFactory = new SearchHistoryTopComponent.DiffResultsViewFactory();
167
        this.diffViewFactory = new SearchHistoryTopComponent.DiffResultsViewFactory();
155
        criteriaVisible = true;
168
        criteriaVisible = true;
Lines 160-165 Link Here
160
        filterTimer.setRepeats(false);
173
        filterTimer.setRepeats(false);
161
        filterTimer.stop();
174
        filterTimer.stop();
162
        setupComponents();
175
        setupComponents();
176
        info.addPropertyChangeListener(WeakListeners.propertyChange(this, info));
163
        aquaBackgroundWorkaround();
177
        aquaBackgroundWorkaround();
164
        refreshComponents(true);
178
        refreshComponents(true);
165
    }
179
    }
Lines 253-258 Link Here
253
        fileInfoCheckBox.setSelected(GitModuleConfig.getDefault().getShowFileInfo());
267
        fileInfoCheckBox.setSelected(GitModuleConfig.getDefault().getShowFileInfo());
254
        
268
        
255
        criteria.btnSelectBranch.addActionListener(this);
269
        criteria.btnSelectBranch.addActionListener(this);
270
        cmbBranch.setRenderer(new DefaultListCellRenderer() {
271
272
            @Override
273
            public Component getListCellRendererComponent (JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
274
                if (value instanceof GitBranch) {
275
                    value = ((GitBranch) value).getName();
276
                }
277
                return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
278
            }
279
            
280
        });
281
        refreshBranchFilterModel();
256
    }
282
    }
257
283
258
    private ExplorerManager             explorerManager;
284
    private ExplorerManager             explorerManager;
Lines 263-268 Link Here
263
            TopComponent tc = (TopComponent) SwingUtilities.getAncestorOfClass(TopComponent.class, this);
289
            TopComponent tc = (TopComponent) SwingUtilities.getAncestorOfClass(TopComponent.class, this);
264
            if (tc == null) return;
290
            if (tc == null) return;
265
            tc.setActivatedNodes((Node[]) evt.getNewValue());
291
            tc.setActivatedNodes((Node[]) evt.getNewValue());
292
        } else if (RepositoryInfo.PROPERTY_BRANCHES.equals(evt.getPropertyName())) {
293
            refreshBranchFilterModel();
266
        }
294
        }
267
    }
295
    }
268
296
Lines 375-380 Link Here
375
            // did user change this setting and cleared the branch field?
403
            // did user change this setting and cleared the branch field?
376
            GitModuleConfig.getDefault().setSearchOnlyCurrentBranchEnabled(criteria.getBranch() != null);
404
            GitModuleConfig.getDefault().setSearchOnlyCurrentBranchEnabled(criteria.getBranch() != null);
377
        }
405
        }
406
        updateBranchFilter(criteria.getBranch());
378
        try {
407
        try {
379
            currentSearch = new SearchExecutor(this);
408
            currentSearch = new SearchExecutor(this);
380
            currentSearch.start(Git.getInstance().getRequestProcessor(repository), repository, NbBundle.getMessage(SearchExecutor.class, "MSG_Search_Progress", repository)); //NOI18N
409
            currentSearch.start(Git.getInstance().getRequestProcessor(repository), repository, NbBundle.getMessage(SearchExecutor.class, "MSG_Search_Progress", repository)); //NOI18N
Lines 436-441 Link Here
436
        tbDiff = new javax.swing.JToggleButton();
465
        tbDiff = new javax.swing.JToggleButton();
437
        jSeparator2 = new javax.swing.JSeparator();
466
        jSeparator2 = new javax.swing.JSeparator();
438
        jSeparator3 = new javax.swing.JToolBar.Separator();
467
        jSeparator3 = new javax.swing.JToolBar.Separator();
468
        jSeparator4 = new javax.swing.JToolBar.Separator();
469
        lblBranch = new javax.swing.JLabel();
470
        cmbBranch = new javax.swing.JComboBox();
439
        jSeparator1 = new javax.swing.JToolBar.Separator();
471
        jSeparator1 = new javax.swing.JToolBar.Separator();
440
        lblFilter = new javax.swing.JLabel();
472
        lblFilter = new javax.swing.JLabel();
441
        cmbFilterKind = new javax.swing.JComboBox();
473
        cmbFilterKind = new javax.swing.JComboBox();
Lines 502-507 Link Here
502
            }
534
            }
503
        });
535
        });
504
        jToolBar1.add(fileInfoCheckBox);
536
        jToolBar1.add(fileInfoCheckBox);
537
        jToolBar1.add(jSeparator4);
538
539
        lblBranch.setLabelFor(cmbBranch);
540
        org.openide.awt.Mnemonics.setLocalizedText(lblBranch, org.openide.util.NbBundle.getMessage(SearchHistoryPanel.class, "branchLabel.text")); // NOI18N
541
        lblBranch.setToolTipText(org.openide.util.NbBundle.getMessage(SearchHistoryPanel.class, "branchLabel.TTtext")); // NOI18N
542
        lblBranch.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5));
543
        jToolBar1.add(lblBranch);
544
545
        cmbBranch.addActionListener(new java.awt.event.ActionListener() {
546
            public void actionPerformed(java.awt.event.ActionEvent evt) {
547
                cmbBranchActionPerformed(evt);
548
            }
549
        });
550
        jToolBar1.add(cmbBranch);
505
        jToolBar1.add(jSeparator1);
551
        jToolBar1.add(jSeparator1);
506
552
507
        org.openide.awt.Mnemonics.setLocalizedText(lblFilter, org.openide.util.NbBundle.getMessage(SearchHistoryPanel.class, "filterLabel.text")); // NOI18N
553
        org.openide.awt.Mnemonics.setLocalizedText(lblFilter, org.openide.util.NbBundle.getMessage(SearchHistoryPanel.class, "filterLabel.text")); // NOI18N
Lines 595-600 Link Here
595
        }
641
        }
596
    }//GEN-LAST:event_cmbFilterKindActionPerformed
642
    }//GEN-LAST:event_cmbFilterKindActionPerformed
597
643
644
    private void cmbBranchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbBranchActionPerformed
645
        Object filter = cmbBranch.getSelectedItem();
646
        boolean refresh = filter != currentBranchFilter;
647
        if (refresh) {
648
            currentBranchFilter = filter;
649
            filterTimer.restart();
650
        }
651
    }//GEN-LAST:event_cmbBranchActionPerformed
652
598
    @Override
653
    @Override
599
    public void insertUpdate(DocumentEvent e) {
654
    public void insertUpdate(DocumentEvent e) {
600
        documentChanged(e);
655
        documentChanged(e);
Lines 654-666 Link Here
654
    final javax.swing.JButton bPrev = new javax.swing.JButton();
709
    final javax.swing.JButton bPrev = new javax.swing.JButton();
655
    private javax.swing.JButton bSearch;
710
    private javax.swing.JButton bSearch;
656
    private javax.swing.ButtonGroup buttonGroup1;
711
    private javax.swing.ButtonGroup buttonGroup1;
712
    private javax.swing.JComboBox cmbBranch;
657
    private javax.swing.JComboBox cmbFilterKind;
713
    private javax.swing.JComboBox cmbFilterKind;
658
    private org.netbeans.modules.versioning.history.LinkButton expandCriteriaButton;
714
    private org.netbeans.modules.versioning.history.LinkButton expandCriteriaButton;
659
    final javax.swing.JCheckBox fileInfoCheckBox = new javax.swing.JCheckBox();
715
    final javax.swing.JCheckBox fileInfoCheckBox = new javax.swing.JCheckBox();
660
    private javax.swing.JToolBar.Separator jSeparator1;
716
    private javax.swing.JToolBar.Separator jSeparator1;
661
    private javax.swing.JSeparator jSeparator2;
717
    private javax.swing.JSeparator jSeparator2;
662
    private javax.swing.JToolBar.Separator jSeparator3;
718
    private javax.swing.JToolBar.Separator jSeparator3;
719
    private javax.swing.JToolBar.Separator jSeparator4;
663
    private javax.swing.JToolBar jToolBar1;
720
    private javax.swing.JToolBar jToolBar1;
721
    private javax.swing.JLabel lblBranch;
664
    private javax.swing.JLabel lblFilter;
722
    private javax.swing.JLabel lblFilter;
665
    private javax.swing.JLabel lblFilterContains;
723
    private javax.swing.JLabel lblFilterContains;
666
    private javax.swing.JPanel resultsPanel;
724
    private javax.swing.JPanel resultsPanel;
Lines 759-764 Link Here
759
                        || contains(rev.getTags(), filterText);
817
                        || contains(rev.getTags(), filterText);
760
            }
818
            }
761
        }
819
        }
820
        Object selectedBranchFilter = currentBranchFilter;
821
        if (visible && selectedBranchFilter instanceof GitBranch) {
822
            visible = rev.getLog().getBranches().containsKey(((GitBranch) currentBranchFilter).getName());
823
        }
762
        return visible;
824
        return visible;
763
    }
825
    }
764
    
826
    
Lines 862-865 Link Here
862
            this.diffViewFactory = fac;
924
            this.diffViewFactory = fac;
863
        }
925
        }
864
    }
926
    }
927
928
    private void refreshBranchFilterModel () {
929
        DefaultComboBoxModel model = new DefaultComboBoxModel();
930
        model.addElement(ALL_BRANCHES_FILTER);
931
        for (Map.Entry<String, GitBranch> e : info.getBranches().entrySet()) {
932
            GitBranch b = e.getValue();
933
            if (b.getName() != GitBranch.NO_BRANCH) {
934
                model.addElement(b);
935
                if (currentBranchFilter instanceof GitBranch && b.getName().equals(((GitBranch) currentBranchFilter).getName())) {
936
                    currentBranchFilter = b;
937
                }
938
            }
939
        }
940
        cmbBranch.setModel(model);
941
        cmbBranch.setSelectedItem(currentBranchFilter);
942
    }
943
944
    private void updateBranchFilter (String branch) {
945
        currentBranchFilter = ALL_BRANCHES_FILTER;
946
        if (branch != null) {
947
            ComboBoxModel model = cmbBranch.getModel();
948
            for (int i = 0; i < model.getSize(); ++i) {
949
                Object filter = model.getElementAt(i);
950
                if (filter instanceof GitBranch && branch.equals(((GitBranch) filter).getName())) {
951
                    currentBranchFilter = filter;
952
                    break;
953
                }
954
            }
955
        }
956
        cmbBranch.setSelectedItem(currentBranchFilter);
957
    }
865
}
958
}
(-)a/git/src/org/netbeans/modules/git/ui/history/SearchHistoryTopComponent.java (-16 / +12 lines)
Lines 51-82 Link Here
51
import java.awt.BorderLayout;
51
import java.awt.BorderLayout;
52
import java.util.List;
52
import java.util.List;
53
import org.netbeans.modules.git.GitModuleConfig;
53
import org.netbeans.modules.git.GitModuleConfig;
54
import org.netbeans.modules.git.ui.repository.RepositoryInfo;
54
55
55
@TopComponent.Description(persistenceType=TopComponent.PERSISTENCE_NEVER, preferredID="Git.SearchHistoryTopComponent")
56
@TopComponent.Description(persistenceType=TopComponent.PERSISTENCE_NEVER, preferredID="Git.SearchHistoryTopComponent")
56
public class SearchHistoryTopComponent extends TopComponent {
57
public class SearchHistoryTopComponent extends TopComponent {
57
58
58
    private SearchHistoryPanel shp;
59
    private SearchHistoryPanel shp;
59
    private SearchCriteriaPanel scp;
60
    private SearchCriteriaPanel scp;
60
    private File[] files;
61
    private final File[] files;
61
    private File repository;
62
    private final File repository;
62
63
    private final RepositoryInfo info;
63
    public SearchHistoryTopComponent () {
64
    
65
    public SearchHistoryTopComponent (File repository, RepositoryInfo info, File[] files) {
66
        this.repository = repository;
67
        this.info = info;
68
        this.files = files;
64
        getAccessibleContext().setAccessibleName(NbBundle.getMessage(SearchHistoryTopComponent.class, "ACSN_SearchHistoryT_Top_Component")); // NOI18N
69
        getAccessibleContext().setAccessibleName(NbBundle.getMessage(SearchHistoryTopComponent.class, "ACSN_SearchHistoryT_Top_Component")); // NOI18N
65
        getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SearchHistoryTopComponent.class, "ACSD_SearchHistoryT_Top_Component")); // NOI18N
70
        getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SearchHistoryTopComponent.class, "ACSD_SearchHistoryT_Top_Component")); // NOI18N
66
    }
67
    
68
    public SearchHistoryTopComponent (File repository, File[] files) {
69
        this();
70
        this.repository = repository;
71
        this.files = files;
72
        initComponents();
71
        initComponents();
73
    }
72
    }
74
    
73
    
75
    SearchHistoryTopComponent (File repository, File file, DiffResultsViewFactory fac) {
74
    SearchHistoryTopComponent (File repository, RepositoryInfo info, File file, DiffResultsViewFactory fac) {
76
        this();
75
        this(repository, info, new File[] { file });
77
        this.repository = repository;
78
        this.files = new File[] { file };
79
        initComponents();
80
        shp.setDiffResultsViewFactory(fac);
76
        shp.setDiffResultsViewFactory(fac);
81
    }
77
    }
82
78
Lines 108-114 Link Here
108
    private void initComponents () {
104
    private void initComponents () {
109
        setLayout(new BorderLayout());
105
        setLayout(new BorderLayout());
110
        scp = new SearchCriteriaPanel();
106
        scp = new SearchCriteriaPanel();
111
        shp = new SearchHistoryPanel(repository, files, scp);
107
        shp = new SearchHistoryPanel(repository, info, files, scp);
112
        add(shp);
108
        add(shp);
113
    }
109
    }
114
110
(-)a/git/src/org/netbeans/modules/git/ui/push/PushAction.java (-1 / +1 lines)
Lines 389-395 Link Here
389
                if (crit != null) {
389
                if (crit != null) {
390
                    final GitProgressSupport supp = this;
390
                    final GitProgressSupport supp = this;
391
                    try {
391
                    try {
392
                        GitRevisionInfo[] revisions = client.log(crit, new ProgressMonitor() {
392
                        GitRevisionInfo[] revisions = client.log(crit, false, new ProgressMonitor() {
393
                            @Override
393
                            @Override
394
                            public boolean isCanceled () {
394
                            public boolean isCanceled () {
395
                                return supp.isCanceled();
395
                                return supp.isCanceled();
(-)a/git/src/org/netbeans/modules/git/ui/rebase/RebaseAction.java (-1 / +1 lines)
Lines 481-487 Link Here
481
        SearchCriteria crit = new SearchCriteria();
481
        SearchCriteria crit = new SearchCriteria();
482
        crit.setRevisionFrom(revisionFrom);
482
        crit.setRevisionFrom(revisionFrom);
483
        crit.setRevisionTo(revisionTo);
483
        crit.setRevisionTo(revisionTo);
484
        GitRevisionInfo[] log = client.log(crit, pm);
484
        GitRevisionInfo[] log = client.log(crit, false, pm);
485
        return convertToEntries(log);
485
        return convertToEntries(log);
486
    }    
486
    }    
487
487
(-)a/git/src/org/netbeans/modules/git/ui/repository/RepositoryBrowserPanel.java (-1 / +1 lines)
Lines 1109-1115 Link Here
1109
                                        crit.setRevisionFrom(id);
1109
                                        crit.setRevisionFrom(id);
1110
                                        crit.setRevisionTo(trackedBranch.getId());
1110
                                        crit.setRevisionTo(trackedBranch.getId());
1111
                                    }
1111
                                    }
1112
                                    GitRevisionInfo[] revs = client.log(crit, GitUtils.NULL_PROGRESS_MONITOR);
1112
                                    GitRevisionInfo[] revs = client.log(crit, false, GitUtils.NULL_PROGRESS_MONITOR);
1113
                                    int diff = (revs.length - 1);
1113
                                    int diff = (revs.length - 1);
1114
                                    if (info.getRevision().equals(trackedBranch.getId())) {
1114
                                    if (info.getRevision().equals(trackedBranch.getId())) {
1115
                                        tt = NbBundle.getMessage(RepositoryBrowserPanel.class, diff == 1 
1115
                                        tt = NbBundle.getMessage(RepositoryBrowserPanel.class, diff == 1 
(-)a/git/src/org/netbeans/modules/git/ui/repository/RevisionListPanel.java (-1 / +1 lines)
Lines 367-373 Link Here
367
                    if (rev != null) {
367
                    if (rev != null) {
368
                        criteria.setRevisionTo(rev.getCommitId());
368
                        criteria.setRevisionTo(rev.getCommitId());
369
                    }
369
                    }
370
                    final GitRevisionInfo[] revs = client.log(criteria, listHistoryMonitor);
370
                    final GitRevisionInfo[] revs = client.log(criteria, false, listHistoryMonitor);
371
                    if (!isCanceled()) {
371
                    if (!isCanceled()) {
372
                        finished = true;
372
                        finished = true;
373
                        EventQueue.invokeLater(new Runnable() {
373
                        EventQueue.invokeLater(new Runnable() {

Return to bug 235882