Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.DirstateReader


    normal = new LinkedHashMap<Path, Record>();
    added = new LinkedHashMap<Path, Record>();
    removed = new LinkedHashMap<Path, Record>();
    merged = new LinkedHashMap<Path, Record>();

    DirstateReader dirstateReader = new DirstateReader(repo, pathPool);
    dirstateReader.readInto(new Inspector() {
     
      public boolean next(EntryKind kind, Record r) {
        if (canonicalPathRewrite != null) {
          Path canonicalPath = pathPool.path(canonicalPathRewrite.rewrite(r.name()));
          if (canonicalPath != r.name()) { // == as they come from the same pool
            assert !canonical2dirstateName.containsKey(canonicalPath); // otherwise there's already a file with same canonical name
            // which can't happen for case-insensitive file system (or there's erroneous PathRewrite, perhaps doing smth else)
            canonical2dirstateName.put(canonicalPath, r.name());
          }
          if (r.copySource() != null) {
            // not sure I need copy origin in the map, I don't seem to use it anywhere,
            // but I guess I'll have to use it some day.
            canonicalPath = pathPool.path(canonicalPathRewrite.rewrite(r.copySource()));
            if (canonicalPath != r.copySource()) {
              canonical2dirstateName.put(canonicalPath, r.copySource());
            }
          }
        }
        switch (kind) {
        case Normal : normal.put(r.name(), r); break;
        case Added :  added.put(r.name(), r); break;
        case Removed : removed.put(r.name(), r); break;
        case Merged : merged.put(r.name1, r); break;
        default: throw new HgInvalidStateException(String.format("Unexpected entry in the dirstate: %s", kind));
        }
        return true;
      }
    });
    parents = dirstateReader.parents();
  }
View Full Code Here


      Pool<Nodeid> cacheRevs = new Pool<Nodeid>();
      Pool<Path> cacheFiles = new Pool<Path>();

      Internals implRepo = Internals.getInstance(repo);
      final DirstateBuilder dirstateBuilder = new DirstateBuilder(implRepo);
      dirstateBuilder.fillFrom(new DirstateReader(implRepo, new Path.SimpleSource(repo.getSessionContext().getPathFactory(), cacheFiles)));
      final HgChangelog clog = repo.getChangelog();
      final Nodeid headCset1 = clog.getRevision(firstCset);
      dirstateBuilder.parents(headCset1, clog.getRevision(secondCset));
      //
      MergeStateBuilder mergeStateBuilder = new MergeStateBuilder(implRepo);
View Full Code Here

      final CancelSupport cancellation = getCancelSupport(null, true);
      cancellation.checkCancelled();
      progress.start(2 + toAdd.size() + toRemove.size());
      Internals implRepo = Internals.getInstance(repo);
      final DirstateBuilder dirstateBuilder = new DirstateBuilder(implRepo);
      dirstateBuilder.fillFrom(new DirstateReader(implRepo, new Path.SimpleSource()));
      progress.worked(1);
      cancellation.checkCancelled();
      for (Path p : toAdd) {
        dirstateBuilder.recordAdded(p, Flags.RegularFile, -1);
        progress.worked(1);
View Full Code Here

      } else {
        csetRevision = changesetToCheckout.get();
      }
      Internals implRepo = Internals.getInstance(repo);
      final DirstateBuilder dirstateBuilder = new DirstateBuilder(implRepo);
      dirstateBuilder.fillFrom(new DirstateReader(implRepo, new Path.SimpleSource()));
      progress.worked(1);
      cancellation.checkCancelled();
     
      final HgCheckoutCommand.CheckoutWorker worker = new HgCheckoutCommand.CheckoutWorker(implRepo);
     
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.DirstateReader

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.