本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
});
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: getState
import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State getState() {
return myState;
}
示例13: getState
import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State getState() {
return state;
}
示例14: HgProcessStateAction
import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
protected HgProcessStateAction(Repository.State state) {
myState = state;
}
示例15: readState
import com.intellij.dvcs.repo.Repository; //导入方法依赖的package包/类
@NotNull
public Repository.State readState() {
return isMergeInProgress() ? Repository.State.MERGING : Repository.State.NORMAL;
}