Show branch name only once in case of multiple heads ( in status bar widget and log branch filter).

This commit is contained in:
Nadya Zabrodina
2013-11-14 18:32:54 +04:00
parent 668c3f4001
commit eb5911c688
@@ -620,12 +620,14 @@ public abstract class HgUtil {
}
public static List<String> getNamesWithoutHashes(Collection<HgNameWithHashInfo> namesWithHashes) {
return ContainerUtil.map(namesWithHashes, new Function<HgNameWithHashInfo, String>() {
@Override
public String fun(HgNameWithHashInfo info) {
return info.getName();
//return names without duplication (actually for several heads in one branch)
List<String> names = new ArrayList<String>();
for (HgNameWithHashInfo hash : namesWithHashes) {
if (!names.contains(hash.getName())) {
names.add(hash.getName());
}
});
}
return names;
}
@NotNull