Examples of walk()


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

      if (cleanCheckout) {
        // remove tracked files from wd (perhaps, just forget 'Added'?)
        // for now, just delete each and every tracked file
        // TODO WorkingCopy container with getFile(HgDataFile/Path) to access files in WD
        HgDirstate dirstate = new HgInternals(repo).getDirstate();
        dirstate.walk(new HgDirstate.Inspector() {
         
          public boolean next(EntryKind kind, Record entry) {
            File f = new File(repo.getWorkingDir(), entry.name().toString());
            if (f.exists()) {
              f.delete();
View Full Code Here

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

    dump.showIgnored = false;
    dump.showClean = false;
    HgStatusCollector sc = new HgStatusCollector(hgRepo);
    final int r1 = 0, r2 = 3;
    System.out.printf("Status for changes between revision %d and %d:\n", r1, r2);
    sc.walk(r1, r2, dump);
    //
    System.out.println("\n\nSame, but sorted in the way hg status does:");
    HgStatusCollector.Record r = sc.status(r1, r2);
    sortAndPrint('M', r.getModified(), null);
    sortAndPrint('A', r.getAdded(), null);
View Full Code Here

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

      } else {
        sc.setScope(scope); // explicitly set, even if null - would be handy once we reuse StatusCollector
        if (startRevision == TIP) {
          sc.change(endRevision, mediator);
        } else {
          sc.walk(startRevision, endRevision, mediator);
        }
      }
      mediator.checkFailure();
    } catch (HgRuntimeException ex) {
      throw new HgLibraryFailureException(ex);
View Full Code Here

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

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

    //
    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

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

    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

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

    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

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

    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

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

      // 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

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

    // 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.