public void testCommitToNonEmpty() throws Exception {
File repoLoc = RepoUtils.initEmptyTempRepo("test-commit2non-empty");
RepoUtils.createFile(new File(repoLoc, "file1"), "hello\n");
new ExecHelper(new OutputParser.Stub(), repoLoc).run("hg", "commit", "--addremove", "-m", "FIRST");
//
HgRepository hgRepo = new HgLookup().detect(repoLoc);
CommitFacility cf = new CommitFacility(Internals.getInstance(hgRepo), 0);
HgDataFile df = hgRepo.getFileNode("file1");
cf.add(df, new ByteArrayDataSource("hello\nworld".getBytes()));
Transaction tr = newTransaction(hgRepo);
Nodeid secondRev = cf.commit("SECOND", tr);