Examples of checkCancelled()


Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

      }
    }
    for (Path r1fname : r1Files) {
      if (scope.accept(r1fname)) {
        inspector.removed(r1fname);
        cs.checkCancelled();
      }
    }
  }
 
  /**
 
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

    } else {
      destination.mkdirs();
    }
    ProgressSupport progress = getProgressSupport(null);
    CancelSupport cancel = getCancelSupport(null, true);
    cancel.checkCancelled();
    // if cloning remote repo, which can stream and no revision is specified -
    // can use 'stream_out' wireproto
    //
    try {
      // pull all changes from the very beginning
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

    //
    try {
      // pull all changes from the very beginning
      // XXX consult getContext() if by any chance has a bundle ready, if not, then read and register
      HgBundle completeChanges = srcRepo.getChanges(Collections.singletonList(NULL));
      cancel.checkCancelled();
      WriteDownMate mate = new WriteDownMate(srcRepo.getSessionContext(), destination, progress, cancel);
      try {
        // instantiate new repo in the destdir
        mate.initEmptyRepository();
        // pull changes
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

      final HandlerDispatcher dispatcher = new HandlerDispatcher() {
 
        @Override
        protected void once(HistoryNode n) throws HgCallbackTargetException, CancelledException, HgRuntimeException {
          handler.treeElement(ei.init(n, currentFileNode));
          cancelHelper.checkCancelled();
        }
      };
 
      // renamed files in the queue are placed with respect to #iterateDirection
      // i.e. if we iterate from new to old, recent filenames come first
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

      progressHelper.start(4 * fileRenamesQueue.size());
      for (int namesIndex = 0, renamesQueueSize = fileRenamesQueue.size(); namesIndex < renamesQueueSize; namesIndex++) {
  
        final QueueElement renameInfo = fileRenamesQueue.get(namesIndex);
        dispatcher.prepare(progressHelper, renameInfo);
        cancelHelper.checkCancelled();
        if (namesIndex > 0) {
          dispatcher.connectWithLastJunctionPoint(renameInfo, fileRenamesQueue.get(namesIndex - 1));
        }
        if (namesIndex + 1 < renamesQueueSize) {
          // there's at least one more name we are going to look at
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

   */
  public void execute() throws HgException, CancelledException {
    try {
      final ProgressSupport progress = getProgressSupport(null);
      final CancelSupport cancellation = getCancelSupport(null, true);
      cancellation.checkCancelled();
      progress.start(6);
      Internals internalRepo = Internals.getInstance(repo);
      if (cleanCheckout) {
        // remove tracked files from wd (perhaps, just forget 'Added'?)
        // for now, just delete each and every tracked file
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

        });
      } else {
        throw new HgBadArgumentException("Sorry, only clean checkout is supported now, use #clean(true)", null);
      }
      progress.worked(1);
      cancellation.checkCancelled();
      final DirstateBuilder dirstateBuilder = new DirstateBuilder(internalRepo);
      final CheckoutWorker worker = new CheckoutWorker(internalRepo);
      HgManifest.Inspector insp = new HgManifest.Inspector() {
       
        public boolean next(Nodeid nid, Path fname, Flags flags) {
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

      final int coRevision = revisionToCheckout.get(HgRepository.TIP);
      dirstateBuilder.parents(repo.getChangelog().getRevision(coRevision), null);
      repo.getManifest().walk(coRevision, coRevision, insp);
      worker.checkFailed();
      progress.worked(3);
      cancellation.checkCancelled();
      File dirstateFile = internalRepo.getRepositoryFile(Dirstate);
      try {
        FileChannel dirstateFileChannel = new FileOutputStream(dirstateFile).getChannel();
        dirstateBuilder.serialize(dirstateFileChannel);
        dirstateFileChannel.close();
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

        dirstateFileChannel.close();
      } catch (IOException ex) {
        throw new HgIOException("Can't write down new directory state", ex, dirstateFile);
      }
      progress.worked(1);
      cancellation.checkCancelled();
      String branchName = repo.getChangelog().range(coRevision, coRevision).get(0).branch();
      assert branchName != null;
      File branchFile = internalRepo.getRepositoryFile(Branch);
      if (HgRepository.DEFAULT_BRANCH_NAME.equals(branchName)) {
        // clean actual branch, if any
View Full Code Here

Examples of org.tmatesoft.hg.util.CancelSupport.checkCancelled()

      FileInputStream fis = null;
      try {
        fis = new FileInputStream(f);
        FileChannel fc = fis.getChannel();
        while (fc.read(buf) != -1) {
          cs.checkCancelled();
          buf.flip();
          int consumed = sink.write(buf);
          progress.worked(flength > Integer.MAX_VALUE ? 1 : consumed);
          buf.compact();
        }
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.