# HG changeset patch # User jrice@netbeans.org # Date 1205324129 0 # Node ID 493266d6e88aa7718f6cd3dc99378f19935fa884 # Parent bc8a9b0fbb1efff2090d6bd8337f727f01334ca4 #129799: Fetching Revisions for Export is slow on large repos - adding similar support to Backout, Strip, Revert and Update diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/Mercurial.java --- a/mercurial/src/org/netbeans/modules/mercurial/Mercurial.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/Mercurial.java Wed Mar 12 12:15:29 2008 +0000 @@ -69,6 +69,9 @@ public class Mercurial { public static final int HG_FETCH_20_REVISIONS = 20; public static final int HG_FETCH_50_REVISIONS = 50; public static final int HG_FETCH_ALL_REVISIONS = -1; + public static final int HG_NUMBER_FETCH_OPTIONS = 3; + public static final int HG_NUMBER_TO_FETCH_DEFAULT = 7; + public static final int HG_MAX_REVISION_COMBO_SIZE = HG_NUMBER_TO_FETCH_DEFAULT + HG_NUMBER_FETCH_OPTIONS; public static final String MERCURIAL_OUTPUT_TAB_TITLE = org.openide.util.NbBundle.getMessage(Mercurial.class, "CTL_Mercurial_DisplayName"); // NOI18N public static final String CHANGESET_STR = "changeset:"; // NOI18N diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java Wed Mar 12 12:15:29 2008 +0000 @@ -81,8 +81,8 @@ public class ExportDiffPanel extends jav private RepositoryRevision repoRev; private File fileToDiff; private HgLogMessage[] messages; - private int fetchRevisionLimit = 7; - private int HG_MAX_COMBO_SIZE = fetchRevisionLimit + 3; + private int fetchRevisionLimit = Mercurial.HG_NUMBER_TO_FETCH_DEFAULT; + private boolean bGettingRevisions = false; /** Creates new form ExportDiffPanel */ public ExportDiffPanel(File repo, RepositoryRevision repoRev, File fileToDiff) { @@ -91,7 +91,7 @@ public class ExportDiffPanel extends jav repository = repo; refreshViewTask = rp.create(new RefreshViewTask()); initComponents(); - revisionsComboBox.setMaximumRowCount(HG_MAX_COMBO_SIZE); + revisionsComboBox.setMaximumRowCount(Mercurial.HG_MAX_REVISION_COMBO_SIZE); if(fileToDiff != null){ org.openide.awt.Mnemonics.setLocalizedText(revisionsLabel, NbBundle.getMessage(ExportDiffPanel.class, "ExportDiffPanel.revisionsLabel.text.forFileDiff")); // NOI18N @@ -218,6 +218,7 @@ private void revisionsComboBoxActionPerf }//GEN-LAST:event_revisionsComboBoxActionPerformed private boolean getMore(String revStr) { + if (bGettingRevisions) return false; boolean bGetMore = false; int limit = -1; @@ -231,7 +232,7 @@ private void revisionsComboBoxActionPerf bGetMore = true; limit = Mercurial.HG_FETCH_ALL_REVISIONS; } - if (bGetMore) { + if (bGetMore && !bGettingRevisions) { fetchRevisionLimit = limit; RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository); HgProgressSupport hgProgressSupport = new HgProgressSupport() { @@ -310,6 +311,7 @@ private void revisionsComboBoxActionPerf } private void refreshRevisions() { + bGettingRevisions = true; OutputLogger logger = OutputLogger.getLogger(Mercurial.MERCURIAL_OUTPUT_TAB_TITLE); messages = HgCommand.getLogMessagesNoFileInfo(repository.getAbsolutePath(), fetchRevisionLimit, logger); @@ -337,6 +339,7 @@ private void revisionsComboBoxActionPerf if (targetRevsSet.size() > 0 ) { revisionsComboBox.setSelectedIndex(0); } + bGettingRevisions = false; } public void actionPerformed(ActionEvent evt) { diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/ui/rollback/BackoutPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/rollback/BackoutPanel.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/rollback/BackoutPanel.java Wed Mar 12 12:15:29 2008 +0000 @@ -49,6 +49,7 @@ import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel; import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.mercurial.HgProgressSupport; import org.netbeans.modules.mercurial.Mercurial; import org.netbeans.modules.mercurial.OutputLogger; import org.netbeans.modules.mercurial.ui.log.HgLogMessage; @@ -69,8 +70,8 @@ public class BackoutPanel extends javax. private Thread refreshViewThread; private RepositoryRevision repoRev; private HgLogMessage[] messages; - - private static final int HG_REVERT_TARGET_LIMIT = 100; + private int fetchRevisionLimit = Mercurial.HG_NUMBER_TO_FETCH_DEFAULT; + private boolean bGettingRevisions = false; /** Creates new form ReverModificationsPanel */ public BackoutPanel(File repo, RepositoryRevision repoRev) { @@ -78,6 +79,7 @@ public class BackoutPanel extends javax. repository = repo; refreshViewTask = rp.create(new RefreshViewTask()); initComponents(); + revisionsComboBox.setMaximumRowCount(Mercurial.HG_MAX_REVISION_COMBO_SIZE); commitMsgField.setText( NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.commitMsgField.text") + // NOI18N BackoutAction.HG_BACKOUT_REVISION); // NOI18N @@ -236,11 +238,42 @@ public class BackoutPanel extends javax. private void revisionsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_revisionsComboBoxActionPerformed int index = revisionsComboBox.getSelectedIndex(); + if(getMore((String) revisionsComboBox.getSelectedItem())) return; + if(messages != null && index >= 0 && index < messages.length ){ changesetPanel1.setInfo(messages[index]); } }//GEN-LAST:event_revisionsComboBoxActionPerformed + private boolean getMore(String revStr) { + if (bGettingRevisions) return false; + boolean bGetMore = false; + int limit = -1; + + if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_20_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_50_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_ALL_REVISIONS; + } + if (bGetMore && !bGettingRevisions) { + fetchRevisionLimit = limit; + RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository); + HgProgressSupport hgProgressSupport = new HgProgressSupport() { + public void perform() { + changesetPanel1.clearInfo(); + refreshRevisions(); + } + }; + hgProgressSupport.start(rp, repository.getAbsolutePath(), + org.openide.util.NbBundle.getMessage(Mercurial.class, "MSG_Fetching_Revisions")); // NOI18N + } + return bGetMore; + } /** * Must NOT be run from AWT. @@ -281,8 +314,9 @@ private void revisionsComboBoxActionPerf } private void refreshRevisions() { + bGettingRevisions = true; OutputLogger logger = OutputLogger.getLogger(Mercurial.MERCURIAL_OUTPUT_TAB_TITLE); - messages = HgCommand.getLogMessages(repository.getAbsolutePath(), HG_REVERT_TARGET_LIMIT, logger); + messages = HgCommand.getLogMessagesNoFileInfo(repository.getAbsolutePath(), fetchRevisionLimit, logger); Set targetRevsSet = new LinkedHashSet(); @@ -298,12 +332,18 @@ private void revisionsComboBoxActionPerf i++; } } + if(targetRevsSet.size() > 0){ + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions")); + } ComboBoxModel targetsModel = new DefaultComboBoxModel(new Vector(targetRevsSet)); revisionsComboBox.setModel(targetsModel); if (targetRevsSet.size() > 0 ) { revisionsComboBox.setSelectedIndex(0); } + bGettingRevisions = false; } private class RefreshViewTask implements Runnable { diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/ui/rollback/StripPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/rollback/StripPanel.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/rollback/StripPanel.java Wed Mar 12 12:15:29 2008 +0000 @@ -49,6 +49,7 @@ import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel; import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.mercurial.HgProgressSupport; import org.netbeans.modules.mercurial.Mercurial; import org.netbeans.modules.mercurial.OutputLogger; import org.netbeans.modules.mercurial.ui.log.HgLogMessage; @@ -67,14 +68,15 @@ public class StripPanel extends javax.sw private static final RequestProcessor rp = new RequestProcessor("MercurialStrip", 1); // NOI18N private Thread refreshViewThread; private HgLogMessage[] messages; - - private static final int HG_STRIP_TARGET_LIMIT = 100; + private int fetchRevisionLimit = Mercurial.HG_NUMBER_TO_FETCH_DEFAULT; + private boolean bGettingRevisions = false; /** Creates new form ReverModificationsPanel */ public StripPanel(File repo) { repository = repo; refreshViewTask = rp.create(new RefreshViewTask()); initComponents(); + revisionsComboBox.setMaximumRowCount(Mercurial.HG_MAX_REVISION_COMBO_SIZE); refreshViewTask.schedule(0); } @@ -223,11 +225,42 @@ public class StripPanel extends javax.sw private void revisionsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_revisionsComboBoxActionPerformed int index = revisionsComboBox.getSelectedIndex(); + if(getMore((String) revisionsComboBox.getSelectedItem())) return; + if(messages != null && index >= 0 && index < messages.length ){ changesetPanel1.setInfo(messages[index]); } }//GEN-LAST:event_revisionsComboBoxActionPerformed + private boolean getMore(String revStr) { + if (bGettingRevisions) return false; + boolean bGetMore = false; + int limit = -1; + + if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_20_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_50_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_ALL_REVISIONS; + } + if (bGetMore && !bGettingRevisions) { + fetchRevisionLimit = limit; + RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository); + HgProgressSupport hgProgressSupport = new HgProgressSupport() { + public void perform() { + changesetPanel1.clearInfo(); + refreshRevisions(); + } + }; + hgProgressSupport.start(rp, repository.getAbsolutePath(), + org.openide.util.NbBundle.getMessage(Mercurial.class, "MSG_Fetching_Revisions")); // NOI18N + } + return bGetMore; + } /** * Must NOT be run from AWT. @@ -256,8 +289,9 @@ private void revisionsComboBoxActionPerf } private void refreshRevisions() { + bGettingRevisions = true; OutputLogger logger = OutputLogger.getLogger(Mercurial.MERCURIAL_OUTPUT_TAB_TITLE); - messages = HgCommand.getLogMessages(repository.getAbsolutePath(), HG_STRIP_TARGET_LIMIT, logger); + messages = HgCommand.getLogMessagesNoFileInfo(repository.getAbsolutePath(), fetchRevisionLimit, logger); Set targetRevsSet = new LinkedHashSet(); @@ -273,12 +307,18 @@ private void revisionsComboBoxActionPerf i++; } } + if(targetRevsSet.size() > 0){ + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions")); + } ComboBoxModel targetsModel = new DefaultComboBoxModel(new Vector(targetRevsSet)); revisionsComboBox.setModel(targetsModel); if (targetRevsSet.size() > 0 ) { revisionsComboBox.setSelectedIndex(0); } + bGettingRevisions = false; } private class RefreshViewTask implements Runnable { diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/ui/update/RevertModificationsPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/update/RevertModificationsPanel.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/update/RevertModificationsPanel.java Wed Mar 12 12:15:29 2008 +0000 @@ -52,6 +52,7 @@ import org.netbeans.api.progress.Progres import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.modules.mercurial.HgModuleConfig; +import org.netbeans.modules.mercurial.HgProgressSupport; import org.netbeans.modules.mercurial.Mercurial; import org.netbeans.modules.mercurial.OutputLogger; import org.netbeans.modules.mercurial.ui.log.HgLogMessage; @@ -71,8 +72,8 @@ public class RevertModificationsPanel ex private Thread refreshViewThread; private static final RequestProcessor rp = new RequestProcessor("MercurialRevert", 1); // NOI18N private HgLogMessage[] messages; - - private static final int HG_REVERT_TARGET_LIMIT = 100; + private int fetchRevisionLimit = Mercurial.HG_NUMBER_TO_FETCH_DEFAULT; + private boolean bGettingRevisions = false; /** Creates new form ReverModificationsPanel */ public RevertModificationsPanel(File repo, File[] files) { @@ -80,6 +81,7 @@ public class RevertModificationsPanel ex revertFiles = files; refreshViewTask = rp.create(new RefreshViewTask()); initComponents(); + revisionsComboBox.setMaximumRowCount(Mercurial.HG_MAX_REVISION_COMBO_SIZE); refreshViewTask.schedule(0); } @@ -202,11 +204,43 @@ public class RevertModificationsPanel ex private void revisionsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_revisionsComboBoxActionPerformed int index = revisionsComboBox.getSelectedIndex(); + if(getMore((String) revisionsComboBox.getSelectedItem())) return; + if(messages != null && index >= 0 && index < messages.length ){ changesetPanel1.setInfo(messages[index]); } }//GEN-LAST:event_revisionsComboBoxActionPerformed - + + private boolean getMore(String revStr) { + if (bGettingRevisions) return false; + boolean bGetMore = false; + int limit = -1; + + if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_20_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_50_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_ALL_REVISIONS; + } + if (bGetMore && !bGettingRevisions) { + fetchRevisionLimit = limit; + RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository); + HgProgressSupport hgProgressSupport = new HgProgressSupport() { + public void perform() { + changesetPanel1.clearInfo(); + refreshRevisions(); + } + }; + hgProgressSupport.start(rp, repository.getAbsolutePath(), + org.openide.util.NbBundle.getMessage(Mercurial.class, "MSG_Fetching_Revisions")); // NOI18N + } + return bGetMore; + } + /** * Must NOT be run from AWT. */ @@ -237,11 +271,10 @@ private void revisionsComboBoxActionPerf } private void refreshRevisions() { + bGettingRevisions = true; OutputLogger logger = OutputLogger.getLogger(Mercurial.MERCURIAL_OUTPUT_TAB_TITLE); - Set setRevertFiles = new HashSet(Arrays.asList(revertFiles)); - - messages = HgCommand.getLogMessages(repository.getAbsolutePath(), - setRevertFiles, HG_REVERT_TARGET_LIMIT, logger); + Set setRevertFiles = new HashSet(Arrays.asList(revertFiles)); + messages = HgCommand.getLogMessages(repository.getAbsolutePath(), setRevertFiles, fetchRevisionLimit, logger); Set targetRevsSet = new LinkedHashSet(); @@ -257,12 +290,18 @@ private void revisionsComboBoxActionPerf i++; } } + if(targetRevsSet.size() > 0){ + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions")); + } ComboBoxModel targetsModel = new DefaultComboBoxModel(new Vector(targetRevsSet)); revisionsComboBox.setModel(targetsModel); if (targetRevsSet.size() > 0 ) { revisionsComboBox.setSelectedIndex(0); } + bGettingRevisions = false; } private class RefreshViewTask implements Runnable { diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/ui/update/UpdatePanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/update/UpdatePanel.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/update/UpdatePanel.java Wed Mar 12 12:15:29 2008 +0000 @@ -49,6 +49,7 @@ import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel; import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.modules.mercurial.HgProgressSupport; import org.netbeans.modules.mercurial.Mercurial; import org.netbeans.modules.mercurial.OutputLogger; import org.netbeans.modules.mercurial.ui.log.HgLogMessage; @@ -67,14 +68,15 @@ public class UpdatePanel extends javax.s private static final RequestProcessor rp = new RequestProcessor("MercurialUpdate", 1); // NOI18N private Thread refreshViewThread; private HgLogMessage[] messages; - - private static final int HG_REVERT_TARGET_LIMIT = 100; + private int fetchRevisionLimit = Mercurial.HG_NUMBER_TO_FETCH_DEFAULT; + private boolean bGettingRevisions = false; /** Creates new form ReverModificationsPanel */ public UpdatePanel(File repo) { repository = repo; refreshViewTask = rp.create(new RefreshViewTask()); initComponents(); + revisionsComboBox.setMaximumRowCount(Mercurial.HG_MAX_REVISION_COMBO_SIZE); refreshViewTask.schedule(0); } @@ -183,10 +185,42 @@ public class UpdatePanel extends javax.s private void revisionsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_revisionsComboBoxActionPerformed int index = revisionsComboBox.getSelectedIndex(); + if(getMore((String) revisionsComboBox.getSelectedItem())) return; + if(messages != null && index >= 0 && index < messages.length ){ changesetPanel1.setInfo(messages[index]); } }//GEN-LAST:event_revisionsComboBoxActionPerformed + + private boolean getMore(String revStr) { + if (bGettingRevisions) return false; + boolean bGetMore = false; + int limit = -1; + + if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_20_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_50_REVISIONS; + } else if (revStr != null && revStr.equals(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions"))) { + bGetMore = true; + limit = Mercurial.HG_FETCH_ALL_REVISIONS; + } + if (bGetMore && !bGettingRevisions) { + fetchRevisionLimit = limit; + RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository); + HgProgressSupport hgProgressSupport = new HgProgressSupport() { + public void perform() { + changesetPanel1.clearInfo(); + refreshRevisions(); + } + }; + hgProgressSupport.start(rp, repository.getAbsolutePath(), + org.openide.util.NbBundle.getMessage(Mercurial.class, "MSG_Fetching_Revisions")); // NOI18N + } + return bGetMore; + } /** * Must NOT be run from AWT. @@ -215,8 +249,9 @@ private void revisionsComboBoxActionPerf } private void refreshRevisions() { + bGettingRevisions = true; OutputLogger logger = OutputLogger.getLogger(Mercurial.MERCURIAL_OUTPUT_TAB_TITLE); - messages = HgCommand.getLogMessages(repository.getAbsolutePath(), HG_REVERT_TARGET_LIMIT, logger); + messages = HgCommand.getLogMessagesNoFileInfo(repository.getAbsolutePath(), fetchRevisionLimit, logger); Set targetRevsSet = new LinkedHashSet(); @@ -232,12 +267,18 @@ private void revisionsComboBoxActionPerf i++; } } + if(targetRevsSet.size() > 0){ + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_20_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_50_Revisions")); + targetRevsSet.add(NbBundle.getMessage(Mercurial.class, "MSG_Fetch_All_Revisions")); + } ComboBoxModel targetsModel = new DefaultComboBoxModel(new Vector(targetRevsSet)); revisionsComboBox.setModel(targetsModel); if (targetRevsSet.size() > 0 ) { revisionsComboBox.setSelectedIndex(0); } + bGettingRevisions = false; } private class RefreshViewTask implements Runnable { diff -r bc8a9b0fbb1e -r 493266d6e88a mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java --- a/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Tue Mar 11 21:23:09 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Wed Mar 12 12:15:29 2008 +0000 @@ -146,6 +146,7 @@ public class HgCommand { private static final String HG_LOG_TEMPLATE_HISTORY_NO_FILEINFO_CMD = "--template=rev:{rev}\\nauth:{author}\\ndesc:{desc}\\ndate:{date|hgdate}\\nid:{node|short}\\n" + // NOI18N "\\nendCS:\\n"; // NOI18N + private static final String HG_LOG_REV_TIP_RANGE = "tip:0"; // NOI18N private static final String HG_LOG_REVISION_OUT = "rev:"; // NOI18N private static final String HG_LOG_AUTHOR_OUT = "auth:"; // NOI18N private static final String HG_LOG_DESCRIPTION_OUT = "desc:"; // NOI18N @@ -1200,6 +1201,13 @@ public class HgCommand { command.add(HG_FLAG_REV_CMD); command.add(revStr); } + + // Make sure revsions listed from "tip" down to "tip - limit" + if(limit >= 0 && dateStr == null && revStr == null){ + command.add(HG_FLAG_REV_CMD); + command.add(HG_LOG_REV_TIP_RANGE); + } + if(bGetFileInfo){ command.add(HG_LOG_TEMPLATE_HISTORY_CMD); }else{