Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.RepositoryState


  }

  private static String getRepositoryName(Repository repository) {
    String repoName = Activator.getDefault().getRepositoryUtil()
        .getRepositoryName(repository);
    RepositoryState state = repository.getRepositoryState();
    if (state != RepositoryState.SAFE)
      return repoName + '|' + state.getDescription();
    else
      return repoName;
  }
View Full Code Here


    // Either we want this to be enabled because a new rebase can be started
    // (main action) or an active rebase can be continued, skipped or
    // aborted (menu items). Even when the main action is not enabled we
    // must enable this because otherwise the menu items cannot be opened.
    RepositoryState state = repo.getRepositoryState();
    return state.isRebasing()
        || RebaseCurrentRefCommand.isEnabledForState(repo, state);
  }
View Full Code Here

      return repository != null;
    if (repository != null) {
      if ("hasGerritConfiguration".equals(property)) //$NON-NLS-1$
        return hasGerritConfiguration(repository);

      RepositoryState state = repository.getRepositoryState();

      if ("canAbortRebase".equals(property)) //$NON-NLS-1$
        switch (state) {
        case REBASING_INTERACTIVE:
          return true;
        case REBASING_REBASING:
          return true;
        default:
          return false;
        }

      if ("canContinueRebase".equals(property)) //$NON-NLS-1$
        switch (state) {
        case REBASING_INTERACTIVE:
          return true;
        default:
          return false;
        }

      // isSTATE checks repository state where STATE is the CamelCase version
      // of the RepositoryState enum values.
      if (property.length() > 3 && property.startsWith("is")) { //$NON-NLS-1$
        // e.g. isCherryPickingResolved => CHERRY_PICKING_RESOLVED
        String lookFor = property.substring(2,3) + property.substring(3).replaceAll("([A-Z])","_$1").toUpperCase()//$NON-NLS-1$//$NON-NLS-2$
        if (state.toString().equals(lookFor))
          return true;
      }
      // invokes test methods of RepositoryState, canCommit etc
      try {
        Method method = RepositoryState.class.getMethod(property);
View Full Code Here

  private void calculateCommitInfo() {
    Repository mergeRepository = null;
    isMergedResolved = false;
    isCherryPickResolved = false;
    RepositoryState state = repository.getRepositoryState();
    canCommit = state.canCommit();
    if (!canCommit) {
      cannotCommitMessage = NLS.bind(UIText.CommitAction_repositoryState,
          state.getDescription());
      return;
    }
    if (state.equals(RepositoryState.MERGING_RESOLVED)) {
      isMergedResolved = true;
      mergeRepository = repository;
    } else if (state.equals(RepositoryState.CHERRY_PICKING_RESOLVED)) {
      isCherryPickResolved = true;
      mergeRepository = repository;
    }
    previousCommit = getHeadCommit(repository);
    final UserConfig config = repository.getConfig().get(UserConfig.KEY);
View Full Code Here

   *            to check
   * @return true if an empty commit without files is allowed in the
   *         current state
   */
  public static boolean isCommitWithoutFilesAllowed(Repository repository) {
    RepositoryState state = repository.getRepositoryState();
    return state == RepositoryState.MERGING_RESOLVED;
  }
View Full Code Here

        string.append(' ');
        string.append(formattedTrackingStatus,
            StyledString.DECORATIONS_STYLER);
      }

      RepositoryState repositoryState = repository.getRepositoryState();
      if (repositoryState != RepositoryState.SAFE) {
        string.append(" - ", StyledString.DECORATIONS_STYLER); //$NON-NLS-1$
        string.append(repositoryState.getDescription(),
            StyledString.DECORATIONS_STYLER);
      }
      string.append(']', StyledString.DECORATIONS_STYLER);
    }
View Full Code Here

public class DecoratableResourceHelper {

  static String getRepositoryName(Repository repository) {
    String repoName = Activator.getDefault().getRepositoryUtil()
        .getRepositoryName(repository);
    RepositoryState state = repository.getRepositoryState();
    if (state != RepositoryState.SAFE)
      return repoName + '|' + state.getDescription();
    else
      return repoName;
  }
View Full Code Here

    Ref r;
    RevCommit commit;

    try {
      RepositoryState state = repo.getRepositoryState();
      final boolean merging = state.equals(RepositoryState.MERGING)
          || state.equals(RepositoryState.MERGING_RESOLVED);
      final boolean cherryPicking = state
          .equals(RepositoryState.CHERRY_PICKING)
          || state.equals(RepositoryState.CHERRY_PICKING_RESOLVED);

      // resolve the ref to a commit
      final ObjectId commitId;
      try {
        commitId = repo.resolve(ref + "^{commit}");
View Full Code Here

  public RevCommit call() throws NoHeadException, NoMessageException,
      UnmergedPathException, ConcurrentRefUpdateException,
      JGitInternalException, WrongRepositoryStateException {
    checkCallable();

    RepositoryState state = repo.getRepositoryState();
    if (!state.canCommit())
      throw new WrongRepositoryStateException(MessageFormat.format(
          JGitText.get().cannotCommitOnARepoWithState, state.name()));
    processOptions(state);

    try {
      if (all && !repo.isBare() && repo.getWorkTree() != null) {
        Git git = new Git(repo);
View Full Code Here

   */
  public Ref call() throws GitAPIException, ConcurrentRefUpdateException,
      InvalidTagNameException, NoHeadException {
    checkCallable();

    RepositoryState state = repo.getRepositoryState();
    processOptions(state);

    try {
      // create the tag object
      TagBuilder newTag = new TagBuilder();
View Full Code Here

TOP

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

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.