Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ProgressMonitor


        Git git = null;
        try
        {

            ProgressMonitor monitor = JGitUtils.getMonitor( getLogger() );

            String branch = version != null ? version.getName() : null;

            if ( StringUtils.isBlank( branch ) )
            {
View Full Code Here


    List<ReceiveCommand> toApply = filterCommands(Result.NOT_ATTEMPTED);
    if (toApply.isEmpty()) {
      return;
    }

    ProgressMonitor updating = NullProgressMonitor.INSTANCE;
    boolean sideBand = isCapabilityEnabled(CAPABILITY_SIDE_BAND_64K);
    if (sideBand) {
      SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut);
      pm.setDelayStart(250, TimeUnit.MILLISECONDS);
      updating = pm;
View Full Code Here

    List<ReceiveCommand> toApply = filterCommands(Result.NOT_ATTEMPTED);
    if (toApply.isEmpty()) {
      return;
    }

    ProgressMonitor updating = NullProgressMonitor.INSTANCE;
    boolean sideBand = isCapabilityEnabled(CAPABILITY_SIDE_BAND_64K);
    if (sideBand) {
      SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut);
      pm.setDelayStart(250, TimeUnit.MILLISECONDS);
      updating = pm;
View Full Code Here

  private void sendPack() throws IOException {
    final boolean sideband = options.contains(OPTION_SIDE_BAND)
        || options.contains(OPTION_SIDE_BAND_64K);

    ProgressMonitor pm = NullProgressMonitor.INSTANCE;
    OutputStream packOut = rawOut;
    SideBandOutputStream msgOut = null;

    if (sideband) {
      int bufsz = SideBandOutputStream.SMALL_BUF;
View Full Code Here

    // abort while the client is computing.
    //
    if (timeoutIn != null)
      timeoutIn.setTimeout(10 * timeout * 1000);

    ProgressMonitor receiving = NullProgressMonitor.INSTANCE;
    ProgressMonitor resolving = NullProgressMonitor.INSTANCE;
    if (sideBand)
      resolving = new SideBandProgressMonitor(msgOut);

    ObjectInserter ins = db.newObjectInserter();
    try {
View Full Code Here

    List<ReceiveCommand> toApply = filterCommands(Result.NOT_ATTEMPTED);
    if (toApply.isEmpty()) {
      return;
    }

    ProgressMonitor updating = NullProgressMonitor.INSTANCE;
    boolean sideBand = isCapabilityEnabled(CAPABILITY_SIDE_BAND_64K);
    if (sideBand) {
      SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut);
      pm.setDelayStart(250, TimeUnit.MILLISECONDS);
      updating = pm;
View Full Code Here

    List<ReceiveCommand> toApply = filterCommands(Result.NOT_ATTEMPTED);
    if (toApply.isEmpty()) {
      return;
    }

    ProgressMonitor updating = NullProgressMonitor.INSTANCE;
    boolean sideBand = isCapabilityEnabled(CAPABILITY_SIDE_BAND_64K);
    if (sideBand) {
      SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut);
      pm.setDelayStart(250, TimeUnit.MILLISECONDS);
      updating = pm;
View Full Code Here

      return false;
    }
  }

  private void sendPack(final boolean sideband) throws IOException {
    ProgressMonitor pm = NullProgressMonitor.INSTANCE;
    OutputStream packOut = rawOut;

    if (sideband) {
      int bufsz = SideBandOutputStream.SMALL_BUF;
      if (options.contains(OPTION_SIDE_BAND_64K))
View Full Code Here

    // abort while the client is computing.
    //
    if (timeoutIn != null)
      timeoutIn.setTimeout(10 * timeout * 1000);

    ProgressMonitor receiving = NullProgressMonitor.INSTANCE;
    ProgressMonitor resolving = NullProgressMonitor.INSTANCE;
    if (sideBand)
      resolving = new SideBandProgressMonitor(msgOut);

    ObjectInserter ins = db.newObjectInserter();
    try {
View Full Code Here

  }

  private void checkConnectivity() throws IOException {
    ObjectIdSubclassMap<ObjectId> baseObjects = null;
    ObjectIdSubclassMap<ObjectId> providedObjects = null;
    ProgressMonitor checking = NullProgressMonitor.INSTANCE;
    if (sideBand) {
      SideBandProgressMonitor m = new SideBandProgressMonitor(msgOut);
      m.setDelayStart(750, TimeUnit.MILLISECONDS);
      checking = m;
    }

    if (checkReferencedIsReachable) {
      baseObjects = parser.getBaseObjectIds();
      providedObjects = parser.getNewObjectIds();
    }
    parser = null;

    final ObjectWalk ow = new ObjectWalk(db);
    ow.setRetainBody(false);
    if (baseObjects != null) {
      ow.sort(RevSort.TOPO);
      if (!baseObjects.isEmpty())
        ow.sort(RevSort.BOUNDARY, true);
    }

    for (final ReceiveCommand cmd : commands) {
      if (cmd.getResult() != Result.NOT_ATTEMPTED)
        continue;
      if (cmd.getType() == ReceiveCommand.Type.DELETE)
        continue;
      ow.markStart(ow.parseAny(cmd.getNewId()));
    }
    for (final ObjectId have : advertisedHaves) {
      RevObject o = ow.parseAny(have);
      ow.markUninteresting(o);

      if (baseObjects != null && !baseObjects.isEmpty()) {
        o = ow.peel(o);
        if (o instanceof RevCommit)
          o = ((RevCommit) o).getTree();
        if (o instanceof RevTree)
          ow.markUninteresting(o);
      }
    }

    checking.beginTask(JGitText.get().countingObjects, ProgressMonitor.UNKNOWN);
    RevCommit c;
    while ((c = ow.next()) != null) {
      checking.update(1);
      if (providedObjects != null //
          && !c.has(RevFlag.UNINTERESTING) //
          && !providedObjects.contains(c))
        throw new MissingObjectException(c, Constants.TYPE_COMMIT);
    }

    RevObject o;
    while ((o = ow.nextObject()) != null) {
      checking.update(1);
      if (o.has(RevFlag.UNINTERESTING))
        continue;

      if (providedObjects != null) {
        if (providedObjects.contains(o))
          continue;
        else
          throw new MissingObjectException(o, o.getType());
      }

      if (o instanceof RevBlob && !db.hasObject(o))
        throw new MissingObjectException(o, Constants.TYPE_BLOB);
    }
    checking.endTask();

    if (baseObjects != null) {
      for (ObjectId id : baseObjects) {
        o = ow.parseAny(id);
        if (!o.has(RevFlag.UNINTERESTING))
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.ProgressMonitor

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.