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 125800
Collapse All | Expand All

(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java (-11 / +4 lines)
Lines 83-89 Link Here
83
83
84
    public String getSelectedRevision() {
84
    public String getSelectedRevision() {
85
        String revStr = (String) revisionsComboBox.getSelectedItem();
85
        String revStr = (String) revisionsComboBox.getSelectedItem();
86
        if (revStr != null) {
86
        revStr = revStr.substring(0, revStr.indexOf(" ")); // NOI18N
87
        revStr = revStr.substring(0, revStr.indexOf(" ")); // NOI18N
88
        }
87
        return revStr;
89
        return revStr;
88
    }
90
    }
89
91
Lines 176-182 Link Here
176
    }
178
    }
177
179
178
    private void refreshRevisions() {
180
    private void refreshRevisions() {
179
        java.util.List<String> targetRevsList = HgCommand.getAllRevisions(repository); 
181
        java.util.List<String> targetRevsList = HgCommand.getRevisions(repository, HG_REVISION_TARGET_LIMIT); 
180
182
181
        Set<String>  targetRevsSet = new LinkedHashSet<String>();
183
        Set<String>  targetRevsSet = new LinkedHashSet<String>();
182
184
Lines 187-193 Link Here
187
        }else{
189
        }else{
188
            size = targetRevsList.size();
190
            size = targetRevsList.size();
189
            int i = 0 ;
191
            int i = 0 ;
190
            while( i < size && i < HG_REVISION_TARGET_LIMIT){
192
            while(i < size){
191
                targetRevsSet.add(targetRevsList.get(i));
193
                targetRevsSet.add(targetRevsList.get(i));
192
                i++;
194
                i++;
193
            }
195
            }
Lines 217-231 Link Here
217
            fileChooser.removeChoosableFileFilter(fileFilter);
219
            fileChooser.removeChoosableFileFilter(fileFilter);
218
220
219
        }
221
        }
220
        //fileChooser.addChoosableFileFilter(new FileFilter() {
221
        //    public boolean accept(File f) {
222
        //        return f.isDirectory();
223
        //    }
224
        //    public String getDescription() {
225
        //        return NbBundle.getMessage(ExportDiffPanel.class, "Folders");// NOI18N
226
        //    }
227
        //});
228
        //fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
229
        fileChooser.showDialog(this, NbBundle.getMessage(ExportDiffPanel.class, "OK_Button"));                                            // NO I18N
222
        fileChooser.showDialog(this, NbBundle.getMessage(ExportDiffPanel.class, "OK_Button"));                                            // NO I18N
230
        File f = fileChooser.getSelectedFile();
223
        File f = fileChooser.getSelectedFile();
231
        if (f != null) {
224
        if (f != null) {
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/status/VersioningPanel.java (-2 / +2 lines)
Lines 139-145 Link Here
139
    public void refreshUpdateTargets(File repository) {
139
    public void refreshUpdateTargets(File repository) {
140
        if( repository == null) return;
140
        if( repository == null) return;
141
        
141
        
142
        java.util.List<String> targetRevsList = HgCommand.getAllRevisions(repository);
142
        java.util.List<String> targetRevsList = HgCommand.getRevisions(repository, HG_UPDATE_TARGET_LIMIT);
143
        Set<String>  targetRevsSet = new LinkedHashSet<String>();
143
        Set<String>  targetRevsSet = new LinkedHashSet<String>();
144
        
144
        
145
        int size;
145
        int size;
Lines 149-155 Link Here
149
        }else{
149
        }else{
150
            size = targetRevsList.size();
150
            size = targetRevsList.size();
151
            int i = 0 ;
151
            int i = 0 ;
152
            while( i < size && i < HG_UPDATE_TARGET_LIMIT){
152
            while(i < size){
153
                targetRevsSet.add(targetRevsList.get(i));
153
                targetRevsSet.add(targetRevsList.get(i));
154
                i++;
154
                i++;
155
            }
155
            }
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/update/RevertModificationsPanel.java (-2 / +2 lines)
Lines 149-155 Link Here
149
    }
149
    }
150
150
151
    private void refreshRevisions() {
151
    private void refreshRevisions() {
152
        java.util.List<String> targetRevsList = HgCommand.getAllRevisionsForFile(repository, revertFiles); 
152
        java.util.List<String> targetRevsList = HgCommand.getRevisionsForFile(repository, revertFiles, HG_REVERT_TARGET_LIMIT); 
153
153
154
        Set<String>  targetRevsSet = new LinkedHashSet<String>();
154
        Set<String>  targetRevsSet = new LinkedHashSet<String>();
155
155
Lines 160-166 Link Here
160
        }else{
160
        }else{
161
            size = targetRevsList.size();
161
            size = targetRevsList.size();
162
            int i = 0 ;
162
            int i = 0 ;
163
            while( i < size && i < HG_REVERT_TARGET_LIMIT){
163
            while(i < size){
164
                targetRevsSet.add(targetRevsList.get(i));
164
                targetRevsSet.add(targetRevsList.get(i));
165
                i++;
165
                i++;
166
            }
166
            }
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java (-7 / +13 lines)
Lines 122-128 Link Here
122
    private static final String HG_REMOVE_FLAG_FORCE_CMD = "--force"; // NOI18N
122
    private static final String HG_REMOVE_FLAG_FORCE_CMD = "--force"; // NOI18N
123
    
123
    
124
    private static final String HG_LOG_CMD = "log"; // NOI18N
124
    private static final String HG_LOG_CMD = "log"; // NOI18N
125
    private static final String HG_LOG_LIMIT_CMD = "-l 1"; // NOI18N
125
    private static final String HG_LOG_LIMIT_ONE_CMD = "-l 1"; // NOI18N
126
    private static final String HG_LOG_LIMIT_CMD = "-l"; // NOI18N
126
    private static final String HG_LOG_TEMPLATE_SHORT_CMD = "--template={rev}\\n{desc|firstline}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N
127
    private static final String HG_LOG_TEMPLATE_SHORT_CMD = "--template={rev}\\n{desc|firstline}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N
127
    private static final String HG_LOG_TEMPLATE_LONG_CMD = "--template={rev}\\n{desc}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N
128
    private static final String HG_LOG_TEMPLATE_LONG_CMD = "--template={rev}\\n{desc}\\n{date|hgdate}\\n{node|short}\\n"; // NOI18N
128
    private static final String HG_CSET_TEMPLATE_CMD = "--template={rev}:{node|short}\\n"; // NOI18N
129
    private static final String HG_CSET_TEMPLATE_CMD = "--template={rev}:{node|short}\\n"; // NOI18N
Lines 608-614 Link Here
608
609
609
        command.add(getHgCommand());
610
        command.add(getHgCommand());
610
        command.add(HG_LOG_CMD);
611
        command.add(HG_LOG_CMD);
611
        command.add(HG_LOG_LIMIT_CMD);
612
        command.add(HG_LOG_LIMIT_ONE_CMD);
612
        command.add(HG_OPT_REPOSITORY);
613
        command.add(HG_OPT_REPOSITORY);
613
        command.add(repository.getAbsolutePath());
614
        command.add(repository.getAbsolutePath());
614
615
Lines 1197-1211 Link Here
1197
     *
1198
     *
1198
     * @param File repository of the mercurial repository's root directory
1199
     * @param File repository of the mercurial repository's root directory
1199
     * @param files to query revisions for
1200
     * @param files to query revisions for
1201
     * @param Int limit on nunmber of revisions (-1 for no limit)
1200
     * @return List<String> list of the revisions of the file - {<rev>:<short cset hash>}
1202
     * @return List<String> list of the revisions of the file - {<rev>:<short cset hash>}
1201
     *         or null if no commits made yet.
1203
     *         or null if no commits made yet.
1202
     */
1204
     */
1203
    public static List<String> getAllRevisionsForFile(File repository, File[] files) {
1205
    public static List<String> getRevisionsForFile(File repository, File[] files, int limit) {
1204
        if (repository == null) return null;
1206
        if (repository == null) return null;
1205
        List<String> command = new ArrayList<String>();
1207
        List<String> command = new ArrayList<String>();
1206
1208
1207
        command.add(getHgCommand());
1209
        command.add(getHgCommand());
1208
        command.add(HG_LOG_CMD);
1210
        command.add(HG_LOG_CMD);
1211
        if (limit >= 0) {
1212
                command.add(HG_LOG_LIMIT_CMD);
1213
                command.add(Integer.toString(limit));
1214
        }
1209
        command.add(HG_OPT_REPOSITORY);
1215
        command.add(HG_OPT_REPOSITORY);
1210
        command.add(repository.getAbsolutePath());
1216
        command.add(repository.getAbsolutePath());
1211
        command.add(HG_CSET_TARGET_TEMPLATE_CMD);
1217
        command.add(HG_CSET_TARGET_TEMPLATE_CMD);
Lines 1225-1239 Link Here
1225
    }
1231
    }
1226
1232
1227
    /**
1233
    /**
1228
     * Get all the revisions for a repository
1234
     * Get the revisions for a repository
1229
     *
1235
     *
1230
     * @param File repository of the mercurial repository's root directory
1236
     * @param File repository of the mercurial repository's root directory
1231
     * @return List<String> list of the revisions of the repository - {<rev>:<short cset hash>}
1237
     * @return List<String> list of the revisions of the repository - {<rev>:<short cset hash>}
1232
     *         or null if no commits made yet.
1238
     *         or null if no commits made yet.
1233
     */
1239
     */
1234
    public static List<String> getAllRevisions(File repository) {
1240
    public static List<String> getRevisions(File repository, int limit) {
1235
        if (repository == null) return null;
1241
        if (repository == null) return null;
1236
        return getAllRevisionsForFile(repository, null);
1242
        return getRevisionsForFile(repository, null, limit);
1237
    }
1243
    }
1238
    
1244
    
1239
    /**
1245
    /**
Lines 1470-1476 Link Here
1470
1476
1471
        command.add(getHgCommand());
1477
        command.add(getHgCommand());
1472
        command.add(HG_LOG_CMD);
1478
        command.add(HG_LOG_CMD);
1473
        command.add(HG_LOG_LIMIT_CMD);
1479
        command.add(HG_LOG_LIMIT_ONE_CMD);
1474
        command.add(HG_OPT_REPOSITORY);
1480
        command.add(HG_OPT_REPOSITORY);
1475
        command.add(repository.getAbsolutePath());
1481
        command.add(repository.getAbsolutePath());
1476
        command.add(template);
1482
        command.add(template);

Return to bug 125800