From 367266abf54936fb06aeabd5915b0c1d73cd6112 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Wed, 5 Mar 2014 16:43:43 +0400 Subject: [PATCH] style: sort hg reference names in getNamesWithoutHashes, unnecessary ui model creation removed --- .../src/org/zmlx/hg4idea/ui/HgCommonDialogWithChoices.java | 1 - plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgCommonDialogWithChoices.java b/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgCommonDialogWithChoices.java index ddd92fdfe609..4c7ff6214e94 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgCommonDialogWithChoices.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgCommonDialogWithChoices.java @@ -118,7 +118,6 @@ public class HgCommonDialogWithChoices extends DialogWrapper { private void updateRepository() { HgRepository repo = hgRepositorySelectorComponent.getRepository(); branchSelector.setModel(new DefaultComboBoxModel(repo.getOpenedBranches().toArray())); - tagSelector.setModel(new DefaultComboBoxModel(HgUtil.getNamesWithoutHashes(repo.getTags()).toArray())); DefaultComboBoxModel tagComboBoxModel = new DefaultComboBoxModel(HgUtil.getNamesWithoutHashes(repo.getTags()).toArray()); tagComboBoxModel.addElement("tip"); //HgRepository does not store 'tip' tag because it is internal and not included in tags file tagSelector.setModel(tagComboBoxModel); diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java b/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java index 50bff5cb51c2..ee7f1b4f5ce4 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java @@ -667,6 +667,7 @@ public abstract class HgUtil { names.add(hash.getName()); } } + Collections.sort(names); return names; }