Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.TrackingRefUpdate$Command


    /**
     * Create an instance of {@link Command }
     *
     */
    public Command createCommand() {
        return new Command();
    }
View Full Code Here


    RefSpec spec = new RefSpec(branch + ":" + branch);
    Iterable<PushResult> resultIterable = git.push().setRemote(remote)
        .setRefSpecs(spec).call();

    PushResult result = resultIterable.iterator().next();
    TrackingRefUpdate trackingRefUpdate = result
        .getTrackingRefUpdate(trackingBranch);

    assertNotNull(trackingRefUpdate);
    assertEquals(trackingBranch, trackingRefUpdate.getLocalName());
    assertEquals(branch, trackingRefUpdate.getRemoteName());
    assertEquals(commit2.getId(), trackingRefUpdate.getNewObjectId());
    assertEquals(commit2.getId(), db.resolve(trackingBranch));
    assertEquals(commit2.getId(), db2.resolve(branch));
  }
View Full Code Here

        .setTagOpt(TagOpt.AUTO_FOLLOW).call();

    Collection<TrackingRefUpdate> refUpdates = result
        .getTrackingRefUpdates();
    assertEquals(1, refUpdates.size());
    TrackingRefUpdate update = refUpdates.iterator().next();
    assertEquals("refs/heads/master", update.getRemoteName());

    assertEquals(originalId, db.resolve(tagName));
  }
View Full Code Here

    Ref tagRef2 = remoteGit.tag().setName(tagName).setForceUpdate(true)
        .call();

    FetchResult result = git.fetch().setRemote("test").setRefSpecs(spec)
        .setTagOpt(TagOpt.FETCH_TAGS).call();
    TrackingRefUpdate update = result.getTrackingRefUpdate(Constants.R_TAGS
        + tagName);
    assertEquals(RefUpdate.Result.FORCED, update.getResult());
    assertEquals(tagRef2.getObjectId(), db.resolve(tagName));
  }
View Full Code Here

          JSONObject object = new JSONObject();
          RemoteRefUpdate.Status status = rru.getStatus();
          if (status != RemoteRefUpdate.Status.UP_TO_DATE || !rm.startsWith(Constants.R_TAGS)) {
            object.put(GitConstants.KEY_COMMIT_MESSAGE, rru.getMessage());
            object.put(GitConstants.KEY_RESULT, status.name());
            TrackingRefUpdate refUpdate = rru.getTrackingRefUpdate();
            if (refUpdate != null) {
              object.put(GitConstants.KEY_REMOTENAME, Repository.shortenRefName(refUpdate.getLocalName()));
              object.put(GitConstants.KEY_LOCALNAME, Repository.shortenRefName(refUpdate.getRemoteName()));
            } else {
              object.put(GitConstants.KEY_REMOTENAME, Repository.shortenRefName(rru.getSrcRef()));
              object.put(GitConstants.KEY_LOCALNAME, Repository.shortenRefName(rru.getRemoteName()));
            }
            updates.put(object);
View Full Code Here

        } else {
          throw new IOException("Unexpected character");
        }
      }
      try {
        out.add(new Command(bytes));
      } finally {
        bytes = null;
        arguments = 0;
      }
    } else if (in.readByte() == '*') {
      long l = readLong(in);
      if (l > Integer.MAX_VALUE) {
        throw new IllegalArgumentException("Java only supports arrays up to " + Integer.MAX_VALUE + " in size");
      }
      int numArgs = (int) l;
      if (numArgs < 0) {
        throw new RedisException("Invalid size: " + numArgs);
      }
      bytes = new byte[numArgs][];
      checkpoint();
      decode(ctx, in, out);
    } else {
      // Go backwards one
      in.readerIndex(in.readerIndex() - 1);
      // Read command -- can't be interupted
      byte[][] b = new byte[1][];
      b[0] = in.readBytes(in.bytesBefore((byte) '\r')).array();
      in.skipBytes(2);
      out.add(new Command(b, true));
    }
  }
View Full Code Here

        boolean isOff = _hasTrueInput(off);
        boolean isOn = _hasTrueInput(on);

        if ((brightLevel >= 0) && (brightLevel <= 100)) {
            _transmit(new Command((_destination), x10.Command.BRIGHT,
                    brightLevel));
        }

        if ((dimLevel >= 0) && (dimLevel <= 100)) {
            _transmit(new Command((_destination), x10.Command.DIM, dimLevel));
        }

        if (isOn) {
            _transmit(new Command((_destination), x10.Command.ON));
        }

        if (isOff) {
            _transmit(new Command((_destination), x10.Command.OFF));
        }
    }
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();

        // Check whether a command is ready.
        if (_commandReady()) {
            Command command = _getCommand();
            receivedCommand.send(0, new StringToken(_commandToString(command)));
        } else {
            receivedCommand.send(0, _EMPTY_STRING);
        }
    }
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();

        // Check whether a command is ready
        if (_commandReady()) {
            Command sensedCommand = _getCommand();
            byte function = sensedCommand.getFunctionByte();
            byte functionOfInterest = Command.BRIGHT;
            String commandValue = command.stringValue();

            if (!commandValue.equals("BRIGHT")) {
                functionOfInterest = Command.DIM;
            }

            String sensedHouseCode = "" + sensedCommand.getHouseCode();
            int sensedUnitCode = sensedCommand.getUnitCode();

            String houseCodeValue = houseCode.stringValue();
            int unitCodeValue = ((IntToken) unitCode.getToken()).intValue();

            if (sensedHouseCode.equals(houseCodeValue)
                    && (sensedUnitCode == unitCodeValue)
                    && (function == functionOfInterest)) {
                level.send(0, new IntToken(sensedCommand.getLevel()));
            } else {
                level.send(0, _NO_COMMAND_TOKEN);
            }
        } else {
            level.send(0, _NO_COMMAND_TOKEN);
View Full Code Here

        boolean isOn = _hasTrueInput(on);
        boolean isOff = _hasTrueInput(off);

        if (isOn) {
            _transmit(new Command((_destination), x10.Command.ON));
        }

        if (isOff) {
            _transmit(new Command((_destination), x10.Command.OFF));
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.TrackingRefUpdate$Command

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.