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


Java HgUtil.getRepositoryDefaultPath方法代码示例

本文整理汇总了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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:HgRegularUpdater.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:HgConfigTest.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:HgRegularUpdater.java

示例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;
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:75,代码来源:HgRegularUpdater.java

示例5: getRepositoryUrl

import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
@Nullable
protected String getRepositoryUrl(VirtualFile root) {
  return HgUtil.getRepositoryDefaultPath(project, root);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:HgRemoteChangesetsCommand.java

示例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;
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:66,代码来源:HgRegularUpdater.java


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