diff test/org/tmatesoft/hg/test/RepoUtils.java @ 631:8a5cdcb27b8f

AIOOBE in HgManifest.RevisionMapper. Provide more details about exception context. Create lock file atomically. Test concurrent pull-rebase and read
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 30 May 2013 15:24:17 +0200
parents fedc54356091
children 4ec2d44e2bf3
line wrap: on
line diff
--- a/test/org/tmatesoft/hg/test/RepoUtils.java	Thu May 23 19:44:28 2013 +0200
+++ b/test/org/tmatesoft/hg/test/RepoUtils.java	Thu May 30 15:24:17 2013 +0200
@@ -66,6 +66,10 @@
 	}
 
 	static File cloneRepoToTempLocation(HgRepository repo, String name, boolean noupdate) throws IOException, InterruptedException {
+		return cloneRepoToTempLocation(repo.getWorkingDir(), name, noupdate, false);
+	}
+
+	static File cloneRepoToTempLocation(File repoLoc, String name, boolean noupdate, boolean usePull) throws IOException, InterruptedException {
 		File testRepoLoc = createEmptyDir(name);
 		ExecHelper eh = new ExecHelper(new OutputParser.Stub(), testRepoLoc.getParentFile());
 		ArrayList<String> cmd = new ArrayList<String>();
@@ -74,7 +78,10 @@
 		if (noupdate) {
 			cmd.add("--noupdate");
 		}
-		cmd.add(repo.getWorkingDir().toString());
+		if (usePull) {
+			cmd.add("--pull");
+		}
+		cmd.add(repoLoc.toString());
 		cmd.add(testRepoLoc.getName());
 		eh.run(cmd.toArray(new String[cmd.size()]));
 		assertEquals("[sanity]", 0, eh.getExitValue());