Repository src = Repository.open(createMercurialRepository());
Files.write("q", new File(src.getDirectory(), "xxx"), utf8());
AddCommand.on(src).execute();
CommitCommand commit = CommitCommand.on(src);
commit.user("test").message("m");
commit.execute();
File tgt = Files.createTempDir();
Repository clone = Repository.clone(tgt, src.getDirectory().getAbsolutePath());
File xxx = new File(tgt, "xxx");
Assert.assertTrue(xxx.exists());
clone.close();