# HG changeset patch # User jrice@netbeans.org # Date 1212059601 -7200 # Node ID f3e5103db2a775e8bb7f43804d3593b42b6a1c8e # Parent b2910b2c0d22d1bdfb2c61c52fb4efc00904d055 #124895: Remove revision label support, not useful for mercurial repos and performance hit diff -r b2910b2c0d22 -r f3e5103db2a7 mercurial/src/org/netbeans/modules/mercurial/MercurialAnnotator.java --- a/mercurial/src/org/netbeans/modules/mercurial/MercurialAnnotator.java Thu May 29 12:31:32 2008 +0200 +++ b/mercurial/src/org/netbeans/modules/mercurial/MercurialAnnotator.java Thu May 29 13:13:21 2008 +0200 @@ -130,16 +130,14 @@ public class MercurialAnnotator extends FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY | FileInformation.STATUS_VERSIONED_MODIFIEDLOCALLY; - public static String ANNOTATION_REVISION = "revision"; // NOI18N public static String ANNOTATION_STATUS = "status"; // NOI18N public static String ANNOTATION_FOLDER = "folder"; // NOI18N - public static String[] LABELS = new String[] {ANNOTATION_REVISION, ANNOTATION_STATUS, ANNOTATION_FOLDER}; + public static String[] LABELS = new String[] {ANNOTATION_STATUS, ANNOTATION_FOLDER}; private FileStatusCache cache; private MessageFormat format; private String emptyFormat; - private Boolean needRevisionForFormat; private File folderToScan; private ConcurrentLinkedQueue dirsToScan = new ConcurrentLinkedQueue(); private RequestProcessor.Task scanTask; @@ -163,24 +161,15 @@ public class MercurialAnnotator extends } public void refresh() { - String string = HgModuleConfig.getDefault().getAnnotationFormat(); //System.getProperty("netbeans.experimental.svn.ui.statusLabelFormat"); // NOI18N + String string = HgModuleConfig.getDefault().getAnnotationFormat(); if (string != null && !string.trim().equals("")) { // NOI18N - needRevisionForFormat = isRevisionInAnnotationFormat(string); - string = string.replaceAll("\\{revision\\}", "\\{0\\}"); // NOI18N - string = string.replaceAll("\\{status\\}", "\\{1\\}"); // NOI18N - string = string.replaceAll("\\{folder\\}", "\\{2\\}"); // NOI18N + string = string.replaceAll("\\{status\\}", "\\{0\\}"); // NOI18N + string = string.replaceAll("\\{folder\\}", "\\{1\\}"); // NOI18N format = new MessageFormat(string); emptyFormat = format.format(new String[] {"", "", ""} , new StringBuffer(), null).toString().trim(); // NOI18N } } - public static boolean isRevisionInAnnotationFormat(String str){ - if (str.indexOf("{revision}") != -1) { // NOI18N - return true; - } else { - return false; - } - } private void initDefaultColor(String name) { String color = System.getProperty("hg.color." + name); // NOI18N @@ -439,24 +428,6 @@ public class MercurialAnnotator extends statusString = info.getShortStatusText(); } - String revisionString = ""; // NOI18N - String binaryString = ""; // NOI18N - - if (needRevisionForFormat) { - if ((status & FileInformation.STATUS_NOTVERSIONED_EXCLUDED) == 0) { - try { - File repository = Mercurial.getInstance().getTopmostManagedParent(file); - String revStr = HgCommand.getLastRevision(repository, file); - if (revStr != null) { - revisionString = revStr; - } - } catch (HgException ex) { - NotifyDescriptor.Exception e = new NotifyDescriptor.Exception(ex); - DialogDisplayer.getDefault().notifyLater(e); - } - } - } - //String stickyString = SvnUtils.getCopy(file); String stickyString = null; if (stickyString == null) { @@ -464,7 +435,6 @@ public class MercurialAnnotator extends } Object[] arguments = new Object[] { - revisionString, statusString, stickyString, }; diff -r b2910b2c0d22 -r f3e5103db2a7 mercurial/src/org/netbeans/modules/mercurial/options/Bundle.properties --- a/mercurial/src/org/netbeans/modules/mercurial/options/Bundle.properties Thu May 29 12:31:32 2008 +0200 +++ b/mercurial/src/org/netbeans/modules/mercurial/options/Bundle.properties Thu May 29 13:13:21 2008 +0200 @@ -66,15 +66,10 @@ MercurialPanel.annotationTextField.text= MercurialPanel.jLabel3.text=&Format -MercurialPanel.annotationTextField.toolTipText='{'{0}'}' stays for Revision
'{'{1}'}' stays for Status
'{'{2}'}' stays for Branch or Tag Name
+MercurialPanel.annotationTextField.toolTipText='{'{0}'}' stays for Status
'{'{1}'}' stays for Branch or Tag Name
-MercurialPanel.label.revision = stays for Revision MercurialPanel.label.status = stays for Status MercurialPanel.label.folder = stays for Branch or Tag Name - -MSG_STATUS_LABEL_WITH_REVSION_TITLE = Revision Label Performance -MSG_STATUS_LABEL_WITH_REVSION_MSG = Revision labels {revision} have been added.\n\nThis can seriously effect performance when viewing Mercurial controlled Projects.\nUsing Show Annotations or Show History on selected files is a more efficient way to get revision information. - MercurialPanel.labelVariables.title=Select Variables MercurialPanel.labelVariables.acsd=Lets you select a Variable diff -r b2910b2c0d22 -r f3e5103db2a7 mercurial/src/org/netbeans/modules/mercurial/options/MercurialPanel.java --- a/mercurial/src/org/netbeans/modules/mercurial/options/MercurialPanel.java Thu May 29 12:31:32 2008 +0200 +++ b/mercurial/src/org/netbeans/modules/mercurial/options/MercurialPanel.java Thu May 29 13:13:21 2008 +0200 @@ -273,10 +273,6 @@ final class MercurialPanel extends javax HgModuleConfig.getDefault().setExportFilename(exportFilenameTextField.getText()); HgModuleConfig.getDefault().setAnnotationFormat(annotationTextField.getText()); HgModuleConfig.getDefault().setBackupOnRevertModifications(backupOnRevertModifications.isSelected()); - if (MercurialAnnotator.isRevisionInAnnotationFormat(annotationTextField.getText())){ - HgUtils.warningDialog(MercurialPanel.class, - "MSG_STATUS_LABEL_WITH_REVSION_TITLE", "MSG_STATUS_LABEL_WITH_REVSION_MSG");// NOI18N - } } boolean valid() {