public static HgVersion parse(String hgOut) {
        String[] lines = hgOut.split("\n");
        String firstLine = lines[0];
        Matcher m = HG_VERSION_PATTERN.matcher(firstLine);
        if (m.matches()) {
            try {
                return new HgVersion(Version.create(
                        asInt(m, 1),
                        asInt(m, 2),
                        asInt(m, 3)));
            } catch (Exception e) {
                throw bomb("cannot parse Hg version : " + hgOut);
            }
        }
        throw bomb("cannot parse Hg version : " + hgOut);
    }
@Test
    void shouldBombIfVersionCannotBeParsed() {
        assertThatExceptionOfType(RuntimeException.class)
                .isThrownBy(() -> HgVersion.parse(WINDOWS_HG_TORTOISE))
                .withMessage("cannot parse Hg version : " + WINDOWS_HG_TORTOISE);
    }