當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。