}
default: throw new HgInvalidStateException(String.format("Unknown change %s", op.kind));
}
}
FileOutputStream fos = new FileOutputStream(configFile);
cfgWrite.update(fos);
fos.close();
} catch (IOException ex) {
String m = String.format("Failed to update configuration file %s", configFile);
throw new HgBadArgumentException(m, ex); // TODO [post-1.0] better exception, it's not bad argument case
}