Package org.tmatesoft.hg.util

Examples of org.tmatesoft.hg.util.ProgressSupport.start()


        prepare(revisionNumber, da); // XXX perhaps, prepare shall return DA (sliced, if needed)
        final ProgressSupport progressSupport = ProgressSupport.Factory.get(sink);
        ByteBuffer buf = ByteBuffer.allocate(actualLen > 8192 ? 8192 : actualLen);
        Preview p = Adaptable.Factory.getAdapter(sink, Preview.class, null);
        if (p != null) {
          progressSupport.start(2 * da.length());
          while (!da.isEmpty()) {
            checkCancelled();
            da.readBytes(buf);
            p.preview(buf);
            buf.clear();
View Full Code Here


          da.reset();
          prepare(revisionNumber, da);
          progressSupport.worked(da.length());
          buf.clear();
        } else {
          progressSupport.start(da.length());
        }
        while (!da.isEmpty()) {
          checkCancelled();
          da.readBytes(buf);
          buf.flip(); // post: position == 0
View Full Code Here

    if (f.exists()) {
      final CancelSupport cs = CancelSupport.Factory.get(sink);
      final ProgressSupport progress = ProgressSupport.Factory.get(sink);
      final long flength = f.length();
      final int bsize = (int) Math.min(flength, 32*1024);
      progress.start((int) (flength > Integer.MAX_VALUE ? flength >>> 15 /*32 kb buf size*/ : flength));
      ByteBuffer buf = ByteBuffer.allocate(bsize);
      FileInputStream fis = null;
      try {
        fis = new FileInputStream(f);
        FileChannel fc = fis.getChannel();
View Full Code Here

  }

  public void execute() throws HgRemoteConnectionException, HgIOException, CancelledException, HgLibraryFailureException {
    final ProgressSupport progress = getProgressSupport(null);
    try {
      progress.start(100);
      //
      // find out missing
      // TODO refactor same code in HgOutgoingCommand #getComparator and #getParentHelper
      final HgChangelog clog = repo.getChangelog();
      final HgParentChildMap<HgChangelog> parentHelper = new HgParentChildMap<HgChangelog>(clog);
View Full Code Here

    wdLock.acquire();
    try {
      final ProgressSupport progress = getProgressSupport(null);
      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();
View Full Code Here

    wdLock.acquire();
    try {
      final ProgressSupport progress = getProgressSupport(null);
      final CancelSupport cancellation = getCancelSupport(null, true);
      cancellation.checkCancelled();
      progress.start(files.size() + 2);
      final int csetRevision;
      if (changesetToCheckout.get() == HgRepository.WORKING_COPY) {
        csetRevision = repo.getChangelog().getRevisionIndex(repo.getWorkingCopyParents().first());
      } else {
        csetRevision = changesetToCheckout.get();
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.