Mercurial > hg4j
comparison 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 |
comparison
equal
deleted
inserted
replaced
630:72c979555cb8 | 631:8a5cdcb27b8f |
---|---|
64 static File cloneRepoToTempLocation(String configRepoName, String name, boolean noupdate) throws HgException, IOException, InterruptedException { | 64 static File cloneRepoToTempLocation(String configRepoName, String name, boolean noupdate) throws HgException, IOException, InterruptedException { |
65 return cloneRepoToTempLocation(Configuration.get().find(configRepoName), name, noupdate); | 65 return cloneRepoToTempLocation(Configuration.get().find(configRepoName), name, noupdate); |
66 } | 66 } |
67 | 67 |
68 static File cloneRepoToTempLocation(HgRepository repo, String name, boolean noupdate) throws IOException, InterruptedException { | 68 static File cloneRepoToTempLocation(HgRepository repo, String name, boolean noupdate) throws IOException, InterruptedException { |
69 return cloneRepoToTempLocation(repo.getWorkingDir(), name, noupdate, false); | |
70 } | |
71 | |
72 static File cloneRepoToTempLocation(File repoLoc, String name, boolean noupdate, boolean usePull) throws IOException, InterruptedException { | |
69 File testRepoLoc = createEmptyDir(name); | 73 File testRepoLoc = createEmptyDir(name); |
70 ExecHelper eh = new ExecHelper(new OutputParser.Stub(), testRepoLoc.getParentFile()); | 74 ExecHelper eh = new ExecHelper(new OutputParser.Stub(), testRepoLoc.getParentFile()); |
71 ArrayList<String> cmd = new ArrayList<String>(); | 75 ArrayList<String> cmd = new ArrayList<String>(); |
72 cmd.add("hg"); | 76 cmd.add("hg"); |
73 cmd.add("clone"); | 77 cmd.add("clone"); |
74 if (noupdate) { | 78 if (noupdate) { |
75 cmd.add("--noupdate"); | 79 cmd.add("--noupdate"); |
76 } | 80 } |
77 cmd.add(repo.getWorkingDir().toString()); | 81 if (usePull) { |
82 cmd.add("--pull"); | |
83 } | |
84 cmd.add(repoLoc.toString()); | |
78 cmd.add(testRepoLoc.getName()); | 85 cmd.add(testRepoLoc.getName()); |
79 eh.run(cmd.toArray(new String[cmd.size()])); | 86 eh.run(cmd.toArray(new String[cmd.size()])); |
80 assertEquals("[sanity]", 0, eh.getExitValue()); | 87 assertEquals("[sanity]", 0, eh.getExitValue()); |
81 return testRepoLoc; | 88 return testRepoLoc; |
82 } | 89 } |