Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/ComplexTest.java @ 637:4a0bab2c6da1
HgInitCommand: expose repo init functionality
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 07 Jun 2013 12:32:15 +0200 |
parents | ffce73efa2c2 |
children | 4ffc17c0b534 |
comparison
equal
deleted
inserted
replaced
636:ffce73efa2c2 | 637:4a0bab2c6da1 |
---|---|
23 import org.junit.Rule; | 23 import org.junit.Rule; |
24 import org.junit.Test; | 24 import org.junit.Test; |
25 import org.tmatesoft.hg.core.HgAddRemoveCommand; | 25 import org.tmatesoft.hg.core.HgAddRemoveCommand; |
26 import org.tmatesoft.hg.core.HgCheckoutCommand; | 26 import org.tmatesoft.hg.core.HgCheckoutCommand; |
27 import org.tmatesoft.hg.core.HgCommitCommand; | 27 import org.tmatesoft.hg.core.HgCommitCommand; |
28 import org.tmatesoft.hg.core.HgInitCommand; | |
28 import org.tmatesoft.hg.core.HgRevertCommand; | 29 import org.tmatesoft.hg.core.HgRevertCommand; |
29 import org.tmatesoft.hg.repo.HgLookup; | |
30 import org.tmatesoft.hg.repo.HgManifest; | 30 import org.tmatesoft.hg.repo.HgManifest; |
31 import org.tmatesoft.hg.repo.HgRepository; | 31 import org.tmatesoft.hg.repo.HgRepository; |
32 import org.tmatesoft.hg.util.Path; | 32 import org.tmatesoft.hg.util.Path; |
33 | 33 |
34 /** | 34 /** |
45 */ | 45 */ |
46 @Test | 46 @Test |
47 public void testLocalScenario1() throws Exception { | 47 public void testLocalScenario1() throws Exception { |
48 File repoLoc = RepoUtils.createEmptyDir("composite-scenario-1"); | 48 File repoLoc = RepoUtils.createEmptyDir("composite-scenario-1"); |
49 // init empty | 49 // init empty |
50 // TODO HgInitCommand | 50 HgRepository hgRepo = new HgInitCommand().location(repoLoc).revlogV1().execute(); |
51 RepoUtils.exec(repoLoc, 0, "hg", "init"); | |
52 HgRepository hgRepo = new HgLookup().detect(repoLoc); | |
53 assertFalse("[sanity]", hgRepo.isInvalid()); | 51 assertFalse("[sanity]", hgRepo.isInvalid()); |
54 assertEquals("[sanity]", 0, hgRepo.getChangelog().getRevisionCount()); | 52 assertEquals("[sanity]", 0, hgRepo.getChangelog().getRevisionCount()); |
55 // add 2 files | 53 // add 2 files |
56 Path fa = Path.create("a"), fb = Path.create("b"); | 54 Path fa = Path.create("a"), fb = Path.create("b"); |
57 final File fileA = new File(repoLoc, fa.toString()); | 55 final File fileA = new File(repoLoc, fa.toString()); |