@Override
	public Result getStatus () {
		List<String> lines = runHg("status");
		int aborts = countStartsWith(lines, ABORT_PREFIX);
		if (aborts > 0) {
			return new Result("abort", firstStartsWith(lines, ABORT_PREFIX), true);
		}
		int count = 0;
		int modified = 0;
		StatusMap statuses = new StatusMap();
		for (String l : lines) {
			if (l.length() > 0) {
				String s = l.substring(0, 1);
				Integer i = statuses.get(s);
				statuses.put(s, i == null ? 1 : i + 1);
				count++;
				if ("MR!".contains(s)) {
					modified++;
				}
			}
		}
		if (count > 0) {
			return new Result(count, statuses.toString(), modified > 0);
		} else {
			return new Result(0, null);
		}
	}