Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector.walk()


//    final Path path = Path.create("src/org/tmatesoft/hg/util/");
//    final Path path = Path.create("src/org/tmatesoft/hg/internal/Experimental.java");
//    final Path path = Path.create("missing-dir/");
//    HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, path);
    HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, new PathGlobMatcher("mi**"));
    wcsc.walk(WORKING_COPY, new StatusDump());
  }
 
  /*
   * Straightforward approach to collect branches, no use of branchheads.cache
   * First, single run - 18 563
View Full Code Here


    //
    System.out.println("\n\nTry hg status --change <rev>:");
    sc.change(0, dump);
    System.out.println("\nStatus against working dir:");
    HgWorkingCopyStatusCollector wcc = new HgWorkingCopyStatusCollector(hgRepo);
    wcc.walk(WORKING_COPY, dump);
    System.out.println();
    System.out.printf("Manifest of the revision %d:\n", r2);
    hgRepo.getManifest().walk(r2, r2, new ManifestDump());
    System.out.println();
    System.out.printf("\nStatus of working dir against %d:\n", r2);
View Full Code Here

    assertTrue(r.getModified().size() == 1);
    // mix files and directories
    final Path readme = Path.create("readme");
    final Path dir = Path.create("dir/");
    sc = HgWorkingCopyStatusCollector.create(repo, readme, dir);
    sc.walk(WORKING_COPY, r = new HgStatusCollector.Record());
    assertTrue(r.getAdded().isEmpty());
    assertTrue(r.getRemoved().size() == 2);
    for (Path p : r.getRemoved()) {
      assertEquals(Path.CompareResult.ImmediateChild, p.compareWith(dir));
    }
View Full Code Here

    final Path file3 = Path.create("dir/file3");
    final Path file5 = Path.create("dir/file5");

    HgWorkingCopyStatusCollector sc = HgWorkingCopyStatusCollector.create(repo, file3, file5);
    HgStatusCollector.Record r;
    sc.walk(WORKING_COPY, r = new HgStatusCollector.Record());
    assertTrue(r.getRemoved().contains(file5));
    assertTrue(r.getIgnored().contains(file3));
    //
    // query for the same file, but with
    sc = HgWorkingCopyStatusCollector.create(repo, new PathGlobMatcher(file3.toString(), file5.toString()));
View Full Code Here

    assertTrue(r.getRemoved().contains(file5));
    assertTrue(r.getIgnored().contains(file3));
    //
    // query for the same file, but with
    sc = HgWorkingCopyStatusCollector.create(repo, new PathGlobMatcher(file3.toString(), file5.toString()));
    sc.walk(WORKING_COPY, r = new HgStatusCollector.Record());
    assertTrue(r.getRemoved().contains(file5));
    assertTrue(r.getIgnored().contains(file3));
  }

  @Test
View Full Code Here

      // I may use number of files in either rev1 or rev2 manifest edition
      mediator.start(statusHandler, getCancelSupport(statusHandler, true), new ChangelogHelper(repo, startRevision));
      if (endRevision == WORKING_COPY) {
        HgWorkingCopyStatusCollector wcsc = scope != null ? HgWorkingCopyStatusCollector.create(repo, scope) : new HgWorkingCopyStatusCollector(repo);
        wcsc.setBaseRevisionCollector(sc);
        wcsc.walk(startRevision, mediator);
      } else {
        sc.setScope(scope); // explicitly set, even if null - would be handy once we reuse StatusCollector
        if (startRevision == TIP) {
          sc.change(endRevision, mediator);
        } else {
View Full Code Here

    // files only
    final Path file2 = Path.create("file2");
    final Path file3 = Path.create("dir/file3");
    HgWorkingCopyStatusCollector sc = HgWorkingCopyStatusCollector.create(repo, file2, file3);
    HgStatusCollector.Record r = new HgStatusCollector.Record();
    sc.walk(WORKING_COPY, r);
    assertTrue(r.getAdded().isEmpty());
    assertTrue(r.getRemoved().isEmpty());
    assertTrue(r.getUnknown().isEmpty());
    assertTrue(r.getClean().isEmpty());
    assertTrue(r.getMissing().isEmpty());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.