comparison test/org/tmatesoft/hg/test/TestStatus.java @ 461:613c883e360e

Do not walk into nested repositories at all, ignore not only .hg but whole nested repo
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 20 Jun 2012 16:51:18 +0200
parents c95cd5994ba2
children 5c09a9f2e073
comparison
equal deleted inserted replaced
460:5311e041d2dd 461:613c883e360e
639 for (Map.Entry<Path, Outcome> e : sc.getErrors().entrySet()) { 639 for (Map.Entry<Path, Outcome> e : sc.getErrors().entrySet()) {
640 System.out.printf("%s : (%s %s)\n", e.getKey(), e.getValue().getKind(), e.getValue().getMessage()); 640 System.out.printf("%s : (%s %s)\n", e.getKey(), e.getValue().getKind(), e.getValue().getMessage());
641 } 641 }
642 assertTrue(sc.getErrors().isEmpty()); 642 assertTrue(sc.getErrors().isEmpty());
643 } 643 }
644
645 @Test
646 public void testNestedRepositoriesAreNotWalkedIn() throws Exception {
647 repo = Configuration.get().find("status-nested-repo");
648 File s2 = new File(repo.getWorkingDir(), "skip/s2/.hg/");
649 File s1 = new File(repo.getWorkingDir(), "s1/.hg/");
650 File s1b = new File(repo.getWorkingDir(), "s1/b");
651 assertTrue("[sanity]", s1.exists() && s1.isDirectory());
652 assertTrue("[sanity]", s1b.exists() && s1b.isFile());
653 assertTrue("[sanity]", s2.exists() && s2.isDirectory());
654 StatusCollector sc = new StatusCollector();
655 new HgStatusCommand(repo).all().execute(sc);
656 List<Path> ignored = sc.get(Ignored);
657 assertEquals(1, ignored.size());
658 assertEquals(Path.create("skip/a"), ignored.get(0));
659 assertTrue(sc.get(Path.create("s1/b")).isEmpty());
660 }
644 661
645 /* 662 /*
646 * With warm-up of previous tests, 10 runs, time in milliseconds 663 * With warm-up of previous tests, 10 runs, time in milliseconds
647 * 'hg status -A': Native client total 953 (95 per run), Java client 94 (9) 664 * 'hg status -A': Native client total 953 (95 per run), Java client 94 (9)
648 * 'hg status -A --rev 3:80': Native client total 1828 (182 per run), Java client 235 (23) 665 * 'hg status -A --rev 3:80': Native client total 1828 (182 per run), Java client 235 (23)