本文整理汇总了Java中org.zmlx.hg4idea.util.HgUtil.getRepositoryDefaultPath方法的典型用法代码示例。如果您正苦于以下问题:Java HgUtil.getRepositoryDefaultPath方法的具体用法?Java HgUtil.getRepositoryDefaultPath怎么用?Java HgUtil.getRepositoryDefaultPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.zmlx.hg4idea.util.HgUtil
的用法示例。
在下文中一共展示了HgUtil.getRepositoryDefaultPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pull
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
private HgCommandExitCode pull(@NotNull VirtualFile repo, @NotNull ProgressIndicator indicator) {
indicator.setText2(HgVcsMessages.message("hg4idea.progress.pull.with.update"));
HgPullCommand hgPullCommand = new HgPullCommand(project, repo);
final String defaultPath = HgUtil.getRepositoryDefaultPath(project, repo);
hgPullCommand.setSource(defaultPath);
return hgPullCommand.execute();
}
示例2: testDefaultPathInClonedRepo
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
public void testDefaultPathInClonedRepo() {
cd(myChildRepo);
final String defaultPath = HgUtil.getRepositoryDefaultPath(myProject, myChildRepo);
assertNotNull(defaultPath);
assertEquals(myRepository.getPath(),
FileUtil.toSystemIndependentName(defaultPath));
}
示例3: pull
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
private boolean pull(VirtualFile repo, ProgressIndicator indicator)
throws VcsException {
indicator.setText2(HgVcsMessages.message("hg4idea.progress.pull.with.update"));
HgPullCommand hgPullCommand = new HgPullCommand(project, repo);
final String defaultPath = HgUtil.getRepositoryDefaultPath(project, repo);
hgPullCommand.setSource(defaultPath);
hgPullCommand.setUpdate(false);
hgPullCommand.setRebase(false);
return hgPullCommand.execute();
}
示例4: update
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
public boolean update(final UpdatedFiles updatedFiles, ProgressIndicator indicator, List<VcsException> warnings)
throws VcsException {
indicator.setText(HgVcsMessages.message("hg4idea.progress.updating", repoRoot.getPath()));
String defaultPath = HgUtil.getRepositoryDefaultPath(project, repoRoot);
if (StringUtil.isEmptyOrSpaces(defaultPath)) {
throw new VcsException(HgVcsMessages.message("hg4idea.warning.no-default-update-path", repoRoot.getPath()));
}
List<HgRevisionNumber> branchHeadsBeforePull = new HgHeadsCommand(project, repoRoot).execute();
if (branchHeadsBeforePull.size() > 1) {
reportWarning(warnings, HgVcsMessages.message("hg4idea.update.warning.multipleHeadsBeforeUpdate", repoRoot.getPath()));
}
//TODO perhaps report a warning in this case ?
// //if the parent of the working dir is not the tip of the current branch, the user has
// //manually brought his working copy to some specific revision. In that case we won't touch
// //his setup
// if (!parentRevision.equals(currentBranchHead)) {
// throw new VcsException("working dir not at branch tip (use \"Update to...\" to check out branch tip)");
// }
if (updateConfiguration.shouldPull()) {
HgCommandExitCode pullResult = pull(repoRoot, indicator);
if (pullResult == HgCommandExitCode.ERROR) {
return false;
}
}
List<HgRevisionNumber> parentsBeforeUpdate = new HgWorkingCopyRevisionsCommand(project).parents(repoRoot);
if (parentsBeforeUpdate.size() > 1) {
throw new VcsException(HgVcsMessages.message("hg4idea.update.error.uncommittedMerge", repoRoot.getPath()));
}
indicator.setText2(HgVcsMessages.message("hg4idea.progress.countingHeads"));
List<HgRevisionNumber> branchHeadsAfterPull = new HgHeadsCommand(project, repoRoot).execute();
List<HgRevisionNumber> pulledBranchHeads = determinePulledBranchHeads(branchHeadsBeforePull, branchHeadsAfterPull);
List<HgRevisionNumber> remainingOriginalBranchHeads =
determingRemainingOriginalBranchHeads(branchHeadsBeforePull, branchHeadsAfterPull);
HgUpdateType updateType = updateConfiguration.getUpdateType();
if (branchHeadsAfterPull.size() > 1 && updateType != ONLY_UPDATE) {
// merge strategy
if (updateType == MERGE) {
abortOnLocalChanges();
abortOnMultiplePulledHeads(pulledBranchHeads);
abortOnMultipleLocalHeads(remainingOriginalBranchHeads);
HgCommandResult mergeResult = doMerge(indicator);
if (updateConfiguration.shouldCommitAfterMerge()) {
commitOrWarnAboutConflicts(warnings, mergeResult);
}
}
//rebase strategy
else {
processRebase(indicator, updatedFiles); //resolve conflicts processed during rebase
return true;
}
}
//if pull complete successfully and there are only one head, we need just update working directory to the head
else {
//in case of multiple heads the update will report the appropriate error
update(repoRoot, indicator, updatedFiles, warnings);
}
//any kind of update could have resulted in merges and merge conflicts, so run the resolver
resolvePossibleConflicts(updatedFiles);
return true;
}
示例5: getRepositoryUrl
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
@Nullable
protected String getRepositoryUrl(VirtualFile root) {
return HgUtil.getRepositoryDefaultPath(project, root);
}
示例6: update
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
public boolean update(final UpdatedFiles updatedFiles, ProgressIndicator indicator, List<VcsException> warnings)
throws VcsException {
indicator.setText(HgVcsMessages.message("hg4idea.progress.updating", repoRoot.getPath()));
String defaultPath = HgUtil.getRepositoryDefaultPath(project, repoRoot);
if (StringUtil.isEmptyOrSpaces(defaultPath)) {
throw new VcsException(HgVcsMessages.message("hg4idea.warning.no-default-update-path", repoRoot.getPath()));
}
List<HgRevisionNumber> branchHeadsBeforePull = new HgHeadsCommand(project, repoRoot).execute();
if (branchHeadsBeforePull.size() > 1) {
reportWarning(warnings, HgVcsMessages.message("hg4idea.update.warning.multipleHeadsBeforeUpdate", repoRoot.getPath()));
}
//TODO perhaps report a warning in this case ?
// //if the parent of the working dir is not the tip of the current branch, the user has
// //manually brought his working copy to some specific revision. In that case we won't touch
// //his setup
// if (!parentRevision.equals(currentBranchHead)) {
// throw new VcsException("working dir not at branch tip (use \"Update to...\" to check out branch tip)");
// }
if (shouldPull()) {
boolean pullResult = pull(repoRoot, indicator);
if (!pullResult) {
return false;
}
}
if (shouldUpdate()) {
List<HgRevisionNumber> parentsBeforeUpdate = new HgWorkingCopyRevisionsCommand(project).parents(repoRoot);
if (parentsBeforeUpdate.size() > 1) {
throw new VcsException(HgVcsMessages.message("hg4idea.update.error.uncommittedMerge", repoRoot.getPath()));
}
indicator.setText2(HgVcsMessages.message("hg4idea.progress.countingHeads"));
List<HgRevisionNumber> branchHeadsAfterPull = new HgHeadsCommand(project, repoRoot).execute();
List<HgRevisionNumber> pulledBranchHeads = determinePulledBranchHeads(branchHeadsBeforePull, branchHeadsAfterPull);
List<HgRevisionNumber> remainingOriginalBranchHeads = determingRemainingOriginalBranchHeads(branchHeadsBeforePull, branchHeadsAfterPull);
if (branchHeadsAfterPull.size() > 1 && shouldMerge()) {
abortOnLocalChanges();
abortOnMultiplePulledHeads(pulledBranchHeads);
abortOnMultipleLocalHeads(remainingOriginalBranchHeads);
HgCommandResult mergeResult = doMerge(updatedFiles, indicator, pulledBranchHeads.get(0));
if (shouldCommitAfterMerge()) {
commitOrWarnAboutConflicts(warnings, mergeResult);
}
} else {
//in case of multiple heads the update will report the appropriate error
update(repoRoot, indicator, updatedFiles, warnings);
}
//any kind of update could have resulted in merges and merge conflicts, so run the resolver
resolvePossibleConflicts(updatedFiles);
}
return true;
}