# HG changeset patch # User Artem Tikhomirov # Date 1340203959 -7200 # Node ID ad0322a4af204547c400e1846b2b83d446ab8da5 # Parent 613c883e360e203f59f9cc28a8deb20650a5c31a Update tests not to fail with Mercurial 2.2 changes, run tests with gradle diff -r 613c883e360e -r ad0322a4af20 build.gradle --- a/build.gradle Wed Jun 20 16:51:18 2012 +0200 +++ b/build.gradle Wed Jun 20 16:52:39 2012 +0200 @@ -142,7 +142,7 @@ // // - File testReposRoot = new File(project.getBuildDir(), "hg4j-tests2/"); + File testReposRoot = new File(project.getBuildDir(), "hg4j-tests/"); if ( testReposRoot.exists() ) { project.delete(testReposRoot) } diff -r 613c883e360e -r ad0322a4af20 test/org/tmatesoft/hg/test/TestHistory.java --- a/test/org/tmatesoft/hg/test/TestHistory.java Wed Jun 20 16:51:18 2012 +0200 +++ b/test/org/tmatesoft/hg/test/TestHistory.java Wed Jun 20 16:52:39 2012 +0200 @@ -31,7 +31,6 @@ import org.junit.Test; import org.tmatesoft.hg.core.HgChangeset; import org.tmatesoft.hg.core.HgChangesetHandler; -import org.tmatesoft.hg.core.HgChangesetHandler.WithCopyHistory; import org.tmatesoft.hg.core.HgFileRevision; import org.tmatesoft.hg.core.HgLogCommand; import org.tmatesoft.hg.core.HgLogCommand.CollectHandler; @@ -168,6 +167,7 @@ @Test public void testOriginalTestLogRepo() throws Exception { + // tests fro mercurial distribution, test-log.t repo = Configuration.get().find("log-1"); HgLogCommand cmd = new HgLogCommand(repo); // funny enough, but hg log -vf a -R c:\temp\hg\test-log\a doesn't work, while --cwd works fine @@ -177,9 +177,13 @@ report("log a", cmd.file("a", false).execute(), true); // changelogParser.reset(); + // fails with Mercurial 2.2.1, @see http://selenic.com/pipermail/mercurial-devel/2012-February/038249.html + // and http://www.selenic.com/hg/rev/60101427d618?rev= +/* FIXME either fix test to update to revision 2, where a was still present, or change command to fail/report problem eh.run("hg", "log", "--debug", "-f", "a", "--cwd", repo.getLocation()); List r = cmd.file("a", true).execute(); report("log -f a", r, true); +*/ // changelogParser.reset(); eh.run("hg", "log", "--debug", "-f", "e", "--cwd", repo.getLocation()); @@ -190,13 +194,29 @@ report("log dir/b", cmd.file("dir/b", false).execute(), true); // changelogParser.reset(); - eh.run("hg", "log", "--debug", "-f", "dir/b", "--cwd", repo.getLocation()); - report("log -f dir/b", cmd.file("dir/b", true).execute(), false /*#1, below*/); +// +// Commented out for the same reason as above hg log -f a - newly introduced error message in Mercurial 2.2 +// when files are not part of the parent revision +// eh.run("hg", "log", "--debug", "-f", "dir/b", "--cwd", repo.getLocation()); +// report("log -f dir/b", cmd.file("dir/b", true).execute(), false /*#1, below*/); /* * #1: false works because presently commands dispatches history of the queried file, and then history * of it's origin. With history comprising of renames only, this effectively gives reversed (newest to oldest) * order of revisions. */ + + // commented tests from above updated to work in 2.2 - update repo to revision where files are present + eh.run("hg", "update", "-q", "-r", "2", "--cwd", repo.getLocation()); + changelogParser.reset(); + eh.run("hg", "log", "--debug", "-f", "a", "--cwd", repo.getLocation()); + List r = cmd.file("a", true).execute(); + report("log -f a", r, true); + changelogParser.reset(); + eh.run("hg", "log", "--debug", "-f", "dir/b", "--cwd", repo.getLocation()); + report("log -f dir/b", cmd.file("dir/b", true).execute(), false /*#1, below*/); + // + // get repo back into clear state, up to the tip + eh.run("hg", "update", "-q", "--cwd", repo.getLocation()); } @Test