comparison src/org/tmatesoft/hg/repo/HgRepoConfig.java @ 369:091666b87f62

Issue 21: Recognize extensions with prefixed names
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 22 Dec 2011 01:46:40 +0300
parents bba9f52cacf3
children 51d682cf9cdc
comparison
equal deleted inserted replaced
368:8107b95f4280 369:091666b87f62
208 ExtensionsSection() { 208 ExtensionsSection() {
209 super("extensions"); 209 super("extensions");
210 } 210 }
211 211
212 public boolean isEnabled(String extensionName) { 212 public boolean isEnabled(String extensionName) {
213 String value = config.getSection(section).get(extensionName); 213 final Map<String, String> sect = config.getSection(section);
214 // empty line, just "extension =" is valid way to enable it 214 String value = sect.get(extensionName);
215 return value != null && (value.length() == 0 || '!' != value.charAt(0)); 215 if (value == null) {
216 value = sect.get("hgext." + extensionName);
217 }
218 if (value == null) {
219 value = sect.get("hgext/" + extensionName);
220 }
221 if (value != null) {
222 // empty line, just "extension =" is valid way to enable it
223 return value.length() == 0 || '!' != value.charAt(0);
224 }
225 return false;
216 } 226 }
217 } 227 }
218 } 228 }