当前位置: 首页>>代码示例>>Java>>正文


Java Repository.State方法代码示例

本文整理汇总了Java中com.intellij.dvcs.repo.Repository.State方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.State方法的具体用法?Java Repository.State怎么用?Java Repository.State使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.dvcs.repo.Repository的用法示例。


在下文中一共展示了Repository.State方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HgRepoInfo

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
public HgRepoInfo(@NotNull String currentBranch,
                  @Nullable String currentRevision,
                  @Nullable String currentTipRevision,
                  @NotNull Repository.State state,
                  @NotNull Map<String, Set<Hash>> branches,
                  @NotNull Collection<HgNameWithHashInfo> bookmarks,
                  @Nullable String currentBookmark,
                  @NotNull Collection<HgNameWithHashInfo> tags,
                  @NotNull Collection<HgNameWithHashInfo> localTags, @NotNull Collection<HgNameWithHashInfo> subrepos,
                  @NotNull List<HgNameWithHashInfo> mqApplied, @NotNull List<String> mqNames) {
  myCurrentBranch = currentBranch;
  myCurrentRevision = currentRevision;
  myTipRevision = currentTipRevision;
  myState = state;
  myBranches = branches;
  myBookmarks = new LinkedHashSet<HgNameWithHashInfo>(bookmarks);
  myCurrentBookmark = currentBookmark;
  myTags = new LinkedHashSet<HgNameWithHashInfo>(tags);
  myLocalTags = new LinkedHashSet<HgNameWithHashInfo>(localTags);
  mySubrepos = new HashSet<HgNameWithHashInfo>(subrepos);
  myMQApplied = mqApplied;
  myMqNames = mqNames;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:HgRepoInfo.java

示例2: getState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@Nullable
public Repository.State getState() {
  Repository.State commonState = null;
  for (Repo repository : myRepositories) {
    Repository.State state = repository.getState();
    if (commonState == null) {
      commonState = state;
    }
    else if (!commonState.equals(state)) {
      return null;
    }
  }
  return commonState;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DvcsMultiRootBranchConfig.java

示例3: GitRepoInfo

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
public GitRepoInfo(@Nullable GitLocalBranch currentBranch, @Nullable String currentRevision, @NotNull Repository.State state,
                   @NotNull Collection<GitRemote> remotes, @NotNull Collection<GitLocalBranch> localBranches,
                   @NotNull Collection<GitRemoteBranch> remoteBranches, @NotNull Collection<GitBranchTrackInfo> branchTrackInfos) {
  myCurrentBranch = currentBranch;
  myCurrentRevision = currentRevision;
  myState = state;
  myRemotes = new LinkedHashSet<GitRemote>(remotes);
  myLocalBranches = new LinkedHashSet<GitLocalBranch>(localBranches);
  myRemoteBranches = new LinkedHashSet<GitRemoteBranch>(remoteBranches);
  myBranchTrackInfos = new LinkedHashSet<GitBranchTrackInfo>(branchTrackInfos);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GitRepoInfo.java

示例4: readState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
GitBranchState readState(@NotNull Collection<GitRemote> remotes) {
  Pair<Set<GitLocalBranch>, Set<GitRemoteBranch>> branches = readBranches(remotes);
  Set<GitLocalBranch> localBranches = branches.first;

  HeadInfo headInfo = readHead();
  Repository.State state = readRepositoryState(headInfo);

  GitLocalBranch currentBranch;
  String currentRevision;
  if (!headInfo.isBranch) {
    currentBranch = null;
    currentRevision = headInfo.content;
  }
  else if (!localBranches.isEmpty()) {
    currentBranch = findCurrentBranch(headInfo, state, localBranches);
    currentRevision = getCurrentRevision(headInfo, currentBranch);
  }
  else if (headInfo.content != null) {
    currentBranch = new GitLocalBranch(headInfo.content, GitBranch.DUMMY_HASH);
    currentRevision = null;
  }
  else {
    currentBranch = null;
    currentRevision = null;
  }
  return new GitBranchState(currentRevision, currentBranch, state, localBranches, branches.second);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:GitRepositoryReader.java

示例5: findCurrentBranch

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@Nullable
private GitLocalBranch findCurrentBranch(@NotNull HeadInfo headInfo,
                                         @NotNull Repository.State state,
                                         @NotNull Set<GitLocalBranch> localBranches) {
  final String currentBranchName = findCurrentBranchName(state, headInfo);
  if (currentBranchName == null) {
    return null;
  }
  return ContainerUtil.find(localBranches, new Condition<GitLocalBranch>() {
    @Override
    public boolean value(GitLocalBranch branch) {
      return branch.getFullName().equals(currentBranchName);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitRepositoryReader.java

示例6: readRepositoryState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
private Repository.State readRepositoryState(@NotNull HeadInfo headInfo) {
  if (isMergeInProgress()) {
    return Repository.State.MERGING;
  }
  if (isRebaseInProgress()) {
    return Repository.State.REBASING;
  }
  if (!headInfo.isBranch) {
    return Repository.State.DETACHED;
  }
  return Repository.State.NORMAL;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GitRepositoryReader.java

示例7: findCurrentBranchName

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@Nullable
private String findCurrentBranchName(@NotNull Repository.State state, @NotNull HeadInfo headInfo) {
  String currentBranch = null;
  if (headInfo.isBranch) {
    currentBranch = headInfo.content;
  }
  else if (state == Repository.State.REBASING) {
    currentBranch = readRebaseDirBranchFile("rebase-apply");
    if (currentBranch == null) {
      currentBranch = readRebaseDirBranchFile("rebase-merge");
    }
  }
  return addRefsHeadsPrefixIfNeeded(currentBranch);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GitRepositoryReader.java

示例8: GitBranchState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
GitBranchState(@Nullable String currentRevision,
               @Nullable GitLocalBranch currentBranch,
               @NotNull Repository.State state,
               @NotNull Collection<GitLocalBranch> localBranches,
               @NotNull Collection<GitRemoteBranch> remoteBranches) {
  this.currentRevision = currentRevision;
  this.currentBranch = currentBranch;
  this.state = state;
  this.localBranches = localBranches;
  this.remoteBranches = remoteBranches;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GitBranchState.java

示例9: isRebaseAllowed

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection<GitRepository> repositories) {
  // TODO links to 'rebase', 'resolve conflicts', etc.
  for (GitRepository repository : repositories) {
    Repository.State state = repository.getState();
    String in = GitUtil.mention(repository);
    String message = null;
    switch (state) {
      case NORMAL:
        if (repository.isFresh()) {
          message = "Repository" + in + " is empty.";
        }
        break;
      case MERGING:
        message = "There is an unfinished merge process" + in + ".<br/>You should complete the merge before starting a rebase";
        break;
      case REBASING:
        message = "There is an unfinished rebase process" + in + ".<br/>You should complete it before starting another rebase";
        break;
      case GRAFTING:
        message = "There is an unfinished cherry-pick process" + in + ".<br/>You should finish it before starting a rebase.";
        break;
      case DETACHED:
        message = "You are in the detached HEAD state" + in + ".<br/>Rebase is not possible.";
        break;
      default:
        LOG.error("Unknown state [" + state.name() + "]");
        message = "Rebase is not possible" + in;
    }
    if (message != null) {
      VcsNotifier.getInstance(project).notifyError("Rebase not Allowed", message);
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:GitRebaseUtils.java

示例10: readState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State readState() {
  if (isRebaseInProgress()) {
    return Repository.State.REBASING;
  }
  else if (isCherryPickInProgress()) {
    return Repository.State.GRAFTING;
  }
  return isMergeInProgress() ? Repository.State.MERGING : Repository.State.NORMAL;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:HgRepositoryReader.java

示例11: readState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State readState() {
  if (isMergeInProgress()) {
    return Repository.State.MERGING;
  }
  if (isRebaseInProgress()) {
    return Repository.State.REBASING;
  }
  Head head = readHead();
  if (!head.isBranch) {
    return Repository.State.DETACHED;
  }
  return Repository.State.NORMAL;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:GitRepositoryReader.java

示例12: getState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State getState() {
  return myState;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GitRepoInfo.java

示例13: getState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State getState() {
  return state;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GitBranchState.java

示例14: HgProcessStateAction

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
protected HgProcessStateAction(Repository.State state) {
  myState = state;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:HgProcessStateAction.java

示例15: readState

import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State readState() {
  return isMergeInProgress() ? Repository.State.MERGING : Repository.State.NORMAL;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:HgRepositoryReader.java


注:本文中的com.intellij.dvcs.repo.Repository.State方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。