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


Java GitCheckoutProvider类代码示例

本文整理汇总了Java中git4idea.checkout.GitCheckoutProvider的典型用法代码示例。如果您正苦于以下问题:Java GitCheckoutProvider类的具体用法?Java GitCheckoutProvider怎么用?Java GitCheckoutProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: clone

import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@When("I clone (\\S+)")
public void I_clone_the_repository(final String url) {
  myAuthenticator = new TestAuthenticator();

  myHttpAuthService.register(myAuthenticator);

  executeOnPooledThread(new Runnable() {
    @Override
    public void run() {
      String projectName = url.substring(url.lastIndexOf('/') + 1).replace(".git", "");
      GitCheckoutProvider.doClone(myProject, myGit, projectName, myTestRoot, url);
      myCloneCompleted.countDown();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitRemoteSteps.java

示例2: doCheckout

import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@Override
public void doCheckout(@NotNull Project project, @Nullable Listener listener) {
  if (!GitUtils.testGitExecutable(project)) return;
  BasicAction.saveAll();

  List<Application> applicationList;
  CcApi ccApi = CcApi.getInstance(project);
  ccApi.login();

  applicationList = getApplicationsFromOrga(project);

  if (applicationList == null || applicationList.size() == 0) {
    Messages.showMessageDialog("No application is currently linked with you application. Impossible to clone and create a project.",
                               "No Application Available", Messages.getErrorIcon());
    return;
  }

  final CleverClone dialog = new CleverClone(project, applicationList);
  if (!dialog.showAndGet()) return;

  final VirtualFile destinationParent = LocalFileSystem.getInstance().findFileByIoFile(new File(dialog.getParentDirectory()));
  if (destinationParent == null) return;

  final String sourceRepositoryURL = dialog.getRepositoryUrl();
  final String directoryName = dialog.getDirectoryName();
  final String parentDirectory = dialog.getParentDirectory();

  Git git = ServiceManager.getService(Git.class);
  GitCheckoutProvider.clone(project, git, listener, destinationParent, sourceRepositoryURL, directoryName, parentDirectory);
}
 
开发者ID:CleverCloud,项目名称:clever-intellij-plugin,代码行数:31,代码来源:CleverCheckoutProvider.java

示例3: clone

import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@When("I clone (\\S+)")
public void I_clone_the_repository(final String url) {
  myAuthenticator = new TestAuthenticator();

  myHttpAuthService.register(myAuthenticator);

  executeOnPooledThread(new Runnable() {
    @Override
    public void run() {
      String projectName = url.substring(url.lastIndexOf('/') + 1).replace(".git", "");
      GitCheckoutProvider.doClone(myProject, new EmptyProgressIndicator(), myGit, projectName, myTestRoot, url);
      myCloneCompleted.countDown();
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:GitRemoteSteps.java

示例4: doCheckout

import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@Override
public void doCheckout(@NotNull final Project project, @Nullable final Listener listener) {
  if (!GithubUtil.testGitExecutable(project)) {
    return;
  }
  BasicAction.saveAll();

  List<GithubRepo> availableRepos;
  try {
    availableRepos = GithubUtil
      .computeValueInModal(project, "Access to GitHub", new ThrowableConvertor<ProgressIndicator, List<GithubRepo>, IOException>() {
        @NotNull
        @Override
        public List<GithubRepo> convert(ProgressIndicator indicator) throws IOException {
          return GithubUtil.runTask(project, GithubAuthDataHolder.createFromSettings(), indicator,
                                    new ThrowableConvertor<GithubConnection, List<GithubRepo>, IOException>() {
                                      @NotNull
                                      @Override
                                      public List<GithubRepo> convert(@NotNull GithubConnection connection) throws IOException {
                                        return GithubApiUtil.getAvailableRepos(connection);
                                      }
                                    }
          );
        }
      });
  }
  catch (IOException e) {
    GithubNotifications.showError(project, "Couldn't get the list of GitHub repositories", e);
    return;
  }
  Collections.sort(availableRepos, new Comparator<GithubRepo>() {
    @Override
    public int compare(final GithubRepo r1, final GithubRepo r2) {
      final int comparedOwners = r1.getUserName().compareTo(r2.getUserName());
      return comparedOwners != 0 ? comparedOwners : r1.getName().compareTo(r2.getName());
    }
  });

  final GitCloneDialog dialog = new GitCloneDialog(project);
  // Add predefined repositories to history
  dialog.prependToHistory("-----------------------------------------------");
  for (int i = availableRepos.size() - 1; i >= 0; i--) {
    dialog.prependToHistory(GithubUrlUtil.getCloneUrl(availableRepos.get(i).getFullPath()));
  }
  if (!dialog.showAndGet()) {
    return;
  }
  dialog.rememberSettings();
  final VirtualFile destinationParent = LocalFileSystem.getInstance().findFileByIoFile(new File(dialog.getParentDirectory()));
  if (destinationParent == null) {
    return;
  }
  final String sourceRepositoryURL = dialog.getSourceRepositoryURL();
  final String directoryName = dialog.getDirectoryName();
  final String parentDirectory = dialog.getParentDirectory();

  Git git = ServiceManager.getService(Git.class);
  GitCheckoutProvider.clone(project, git, listener, destinationParent, sourceRepositoryURL, directoryName, parentDirectory);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:60,代码来源:GithubCheckoutProvider.java

示例5: getCheckoutProvider

import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@Override
public CheckoutProvider getCheckoutProvider() {
  return new GitCheckoutProvider(ServiceManager.getService(Git.class));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GitVcs.java


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