Mercurial > jhg
comparison test/org/tmatesoft/hg/test/TestCommit.java @ 613:f41dd9a3b8af v1.1m4
Remove few Experimental annotations as the API they've marked graduates
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 10 May 2013 17:31:27 +0200 |
parents | dca70c0b1f74 |
children | 65c01508f002 |
comparison
equal
deleted
inserted
replaced
612:dca70c0b1f74 | 613:f41dd9a3b8af |
---|---|
113 assertArrayEquals(initialContent, bac.toArray()); | 113 assertArrayEquals(initialContent, bac.toArray()); |
114 } | 114 } |
115 | 115 |
116 @Test | 116 @Test |
117 public void testCommitIntoBranch() throws Exception { | 117 public void testCommitIntoBranch() throws Exception { |
118 File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-add-remove-commit", false); | 118 File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-commit2branch", false); |
119 HgRepository hgRepo = new HgLookup().detect(repoLoc); | 119 HgRepository hgRepo = new HgLookup().detect(repoLoc); |
120 HgDataFile dfD = hgRepo.getFileNode("d"); | 120 HgDataFile dfD = hgRepo.getFileNode("d"); |
121 assertTrue("[sanity]", dfD.exists()); | 121 assertTrue("[sanity]", dfD.exists()); |
122 File fileD = new File(repoLoc, "d"); | 122 File fileD = new File(repoLoc, "d"); |
123 assertTrue("[sanity]", fileD.canRead()); | 123 assertTrue("[sanity]", fileD.canRead()); |
158 FileContentSupplier contentProvider = new FileContentSupplier(new File(repoLoc, "xx")); | 158 FileContentSupplier contentProvider = new FileContentSupplier(new File(repoLoc, "xx")); |
159 cf.add(hgRepo.getFileNode("xx"), contentProvider); | 159 cf.add(hgRepo.getFileNode("xx"), contentProvider); |
160 cf.forget(hgRepo.getFileNode("d")); | 160 cf.forget(hgRepo.getFileNode("d")); |
161 Nodeid commitRev = cf.commit("Commit with add/remove cmd"); | 161 Nodeid commitRev = cf.commit("Commit with add/remove cmd"); |
162 contentProvider.done(); | 162 contentProvider.done(); |
163 // Note, working directory still points to original revision, CommitFacility doesn't update dirstate | |
164 // | 163 // |
165 List<HgChangeset> commits = new HgLogCommand(hgRepo).changeset(commitRev).execute(); | 164 List<HgChangeset> commits = new HgLogCommand(hgRepo).changeset(commitRev).execute(); |
166 HgChangeset cmt = commits.get(0); | 165 HgChangeset cmt = commits.get(0); |
167 errorCollector.assertEquals(1, cmt.getAddedFiles().size()); | 166 errorCollector.assertEquals(1, cmt.getAddedFiles().size()); |
168 errorCollector.assertEquals("xx", cmt.getAddedFiles().get(0).getPath().toString()); | 167 errorCollector.assertEquals("xx", cmt.getAddedFiles().get(0).getPath().toString()); |
177 /** | 176 /** |
178 * perform few commits one by one, into different branches | 177 * perform few commits one by one, into different branches |
179 */ | 178 */ |
180 @Test | 179 @Test |
181 public void testSequentialCommits() throws Exception { | 180 public void testSequentialCommits() throws Exception { |
182 File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-add-remove-commit", false); | 181 File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-sequential-commits", false); |
183 HgRepository hgRepo = new HgLookup().detect(repoLoc); | 182 HgRepository hgRepo = new HgLookup().detect(repoLoc); |
184 HgDataFile dfD = hgRepo.getFileNode("d"); | 183 HgDataFile dfD = hgRepo.getFileNode("d"); |
185 assertTrue("[sanity]", dfD.exists()); | 184 assertTrue("[sanity]", dfD.exists()); |
186 File fileD = new File(repoLoc, "d"); | 185 File fileD = new File(repoLoc, "d"); |
187 assertTrue("[sanity]", fileD.canRead()); | 186 assertTrue("[sanity]", fileD.canRead()); |