Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgStatusCollector$Record


  private void bunchOfTests() throws Exception {
    final StatusDump dump = new StatusDump();
    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);
    sortAndPrint('R', r.getRemoved(), null);
    //
    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);
View Full Code Here


      throw new IllegalArgumentException();
    }
    if (mediator.busy()) {
      throw new ConcurrentModificationException();
    }
    HgStatusCollector sc = new HgStatusCollector(repo); // TODO from CommandContext
//    PathPool pathHelper = new PathPool(repo.getPathHelper()); // TODO from CommandContext
    try {
      // XXX if I need a rough estimation (for ProgressMonitor) of number of work units,
      // 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 {
          sc.walk(startRevision, endRevision, mediator);
        }
      }
      mediator.checkFailure();
    } catch (HgRuntimeException ex) {
      throw new HgLibraryFailureException(ex);
View Full Code Here

    sr.report("status -A --rev " + revision, r);
    //
    statusParser.reset();
    eh.run("hg", "status", "-A", "--change", String.valueOf(revision));
    r = new HgStatusCollector.Record();
    new HgStatusCollector(repo).change(revision, r);
    sr.report("status -A --change " + revision, r);
    //
    statusParser.reset();
    int rev2 = 80;
    final String range = String.valueOf(revision) + ":" + String.valueOf(rev2);
    eh.run("hg", "status", "-A", "--rev", range);
    r = new HgStatusCollector(repo).status(revision, rev2);
    sr.report("Status -A -rev " + range, r);
  }
View Full Code Here

    }

    // init only when needed
    void initTransform() throws HgRuntimeException {
      if (transform == null) {
        transform = new ChangesetTransformer.Transformation(new HgStatusCollector(repo)/*XXX try to reuse from context?*/, getParentHelper(false));
      }
    }
View Full Code Here

      throw new IllegalArgumentException();
    }
    if (ps == null || cs == null) {
      throw new IllegalArgumentException();
    }
    HgStatusCollector statusCollector = new HgStatusCollector(hgRepo);
    t = new Transformation(statusCollector, pw);
    handler = delegate;
    // lifecycleBridge takes care of progress and cancellation, plus
    // gives us explicit way to stop iteration (once HgCallbackTargetException) comes.
    lifecycleBridge = new LifecycleBridge(ps, cs);
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.repo.HgStatusCollector$Record

Copyright © 2018 www.massapicom. 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.