comparison cmdline/org/tmatesoft/hg/console/Main.java @ 362:4937e35b805b

Report dirstate access error with Exception
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 09 Dec 2011 01:14:41 +0100
parents 150500515714
children 189dc6dc1c3e
comparison
equal deleted inserted replaced
361:8099939af5fa 362:4937e35b805b
332 cmd.changeset(cset); 332 cmd.changeset(cset);
333 final ByteArrayChannel sink = new ByteArrayChannel(); 333 final ByteArrayChannel sink = new ByteArrayChannel();
334 cmd.execute(sink); 334 cmd.execute(sink);
335 System.out.println(sink.toArray().length); 335 System.out.println(sink.toArray().length);
336 HgFileInformer i = new HgFileInformer(hgRepo); 336 HgFileInformer i = new HgFileInformer(hgRepo);
337 boolean result = i.changeset(cset).check(file); 337 boolean result = i.changeset(cset).checkExists(file);
338 Assert.assertFalse(result); 338 Assert.assertFalse(result);
339 Assert.assertFalse(i.exists()); 339 Assert.assertFalse(i.exists());
340 result = i.followRenames(true).check(file); 340 result = i.followRenames(true).checkExists(file);
341 Assert.assertTrue(result); 341 Assert.assertTrue(result);
342 Assert.assertTrue(i.exists()); 342 Assert.assertTrue(i.exists());
343 HgCatCommand cmd2 = new HgCatCommand(hgRepo).revision(i.getFileRevision()); 343 HgCatCommand cmd2 = new HgCatCommand(hgRepo).revision(i.getFileRevision());
344 final ByteArrayChannel sink2 = new ByteArrayChannel(); 344 final ByteArrayChannel sink2 = new ByteArrayChannel();
345 cmd2.execute(sink2); 345 cmd2.execute(sink2);
365 final ByteArrayChannel sink = new ByteArrayChannel(); 365 final ByteArrayChannel sink = new ByteArrayChannel();
366 r.putContentTo(sink); 366 r.putContentTo(sink);
367 return String.format("%s %s (%d bytes)", r.getPath(), r.getRevision(), sink.toArray().length); 367 return String.format("%s %s (%d bytes)", r.getPath(), r.getRevision(), sink.toArray().length);
368 } 368 }
369 369
370 private void testFileStatus() throws IOException { 370 private void testFileStatus() throws HgException, IOException {
371 // final Path path = Path.create("src/org/tmatesoft/hg/util/"); 371 // final Path path = Path.create("src/org/tmatesoft/hg/util/");
372 // final Path path = Path.create("src/org/tmatesoft/hg/internal/Experimental.java"); 372 // final Path path = Path.create("src/org/tmatesoft/hg/internal/Experimental.java");
373 // final Path path = Path.create("missing-dir/"); 373 // final Path path = Path.create("missing-dir/");
374 // HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, path); 374 // HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, path);
375 HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, new PathGlobMatcher("mi**")); 375 HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, new PathGlobMatcher("mi**"));