Examples of GitRepository


Examples of git4idea.repo.GitRepository

            NotifyUtil.notifyError(project, "Config error", e);
        }
    }

    public static void setReleasePrefix(Project project, String prefix) {
        GitRepository repo = GitBranchUtil.getCurrentRepository(project);
        VirtualFile root = repo.getRoot();

        try {
            GitConfigUtil.setValue(project, root, PREFIX_RELEASE, prefix);
        } catch (VcsException e) {
            NotifyUtil.notifyError(project, "Config error", e);
View Full Code Here

Examples of git4idea.repo.GitRepository

            NotifyUtil.notifyError(project, "Config error", e);
        }
    }

    public static void setFeaturePrefix(Project project, String prefix) {
        GitRepository repo = GitBranchUtil.getCurrentRepository(project);
        VirtualFile root = repo.getRoot();

        try {
            GitConfigUtil.setValue(project, root, PREFIX_FEATURE, prefix);
        } catch (VcsException e) {
            NotifyUtil.notifyError(project, "Config error", e);
View Full Code Here

Examples of git4idea.repo.GitRepository

            NotifyUtil.notifyError(project, "Config error", e);
        }
    }

    public static void setHotfixPrefix(Project project, String prefix) {
        GitRepository repo = GitBranchUtil.getCurrentRepository(project);
        VirtualFile root = repo.getRoot();

        try {
            GitConfigUtil.setValue(project, root, PREFIX_HOTFIX, prefix);
        } catch (VcsException e) {
            NotifyUtil.notifyError(project, "Config error", e);
View Full Code Here

Examples of git4idea.repo.GitRepository

            NotifyUtil.notifyError(project, "Config error", e);
        }
    }

    public static void setSupportPrefix(Project project, String prefix) {
        GitRepository repo = GitBranchUtil.getCurrentRepository(project);
        VirtualFile root = repo.getRoot();

        try {
            GitConfigUtil.setValue(project, root, PREFIX_SUPPORT, prefix);
        } catch (VcsException e) {
            NotifyUtil.notifyError(project, "Config error", e);
View Full Code Here

Examples of git4idea.repo.GitRepository

            NotifyUtil.notifyError(project, "Config error", e);
        }
    }

    public static void setVersionPrefix(Project project, String prefix) {
        GitRepository repo = GitBranchUtil.getCurrentRepository(project);
        VirtualFile root = repo.getRoot();

        try {
            GitConfigUtil.setValue(project, root, PREFIX_VERSIONTAG, prefix);
        } catch (VcsException e) {
            NotifyUtil.notifyError(project, "Config error", e);
View Full Code Here

Examples of git4idea.repo.GitRepository

    private List<Change> getChangesWithCommitMessage(GitCommit gitCommit) {
        List<Change> changes = gitCommit.getChanges();

        String content = new CommitMessageFormatter(gitCommit).getLongCommitMessage();
        GitRepository repository = gerritGitUtil.getRepositoryForGerritProject(project, selectedChange.project).get();
        VirtualFile root = getRootDirectory(repository.getRoot());
        FilePathImpl commitMsg = new FilePathImpl(root, "COMMIT_MSG", false) {
            @Override
            public FileType getFileType() {
                return PlainTextFileType.INSTANCE;
            }
View Full Code Here

Examples of git4idea.repo.GitRepository

        new Task.Backgroundable(project, "Cherry-picking...", false) {
            public void run(@NotNull ProgressIndicator indicator) {
                try {
                    Optional<GitRepository> gitRepositoryOptional = getRepositoryForGerritProject(project, changeInfo.project);
                    if (!gitRepositoryOptional.isPresent()) return;
                    GitRepository gitRepository = gitRepositoryOptional.get();

                    final VirtualFile virtualFile = gitRepository.getGitDir();

                    final String notLoaded = "Not loaded";
                    GitCommit gitCommit = new GitCommit(virtualFile, AbstractHash.create(revisionId), new SHAHash(revisionId), notLoaded, notLoaded, new Date(0), notLoaded,
                            notLoaded, Collections.<String>emptySet(), Collections.<FilePath>emptyList(), notLoaded,
                            notLoaded, Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList(),
View Full Code Here

Examples of git4idea.repo.GitRepository

        GitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(project);
        final Collection<GitRepository> repositoriesFromRoots = repositoryManager.getRepositories();

        Optional<GitRepository> gitRepositoryOptional = gerritGitUtil.getRepositoryForGerritProject(project, changeInfo.project);
        if (!gitRepositoryOptional.isPresent()) return;
        GitRepository gitRepository = gitRepositoryOptional.get();

        final String branchName = "FETCH_HEAD";
        GitLocalBranch currentBranch = gitRepository.getCurrentBranch();
        final String currentBranchName;
        if (currentBranch != null) {
            currentBranchName = currentBranch.getFullName();
        } else {
            currentBranchName = gitRepository.getCurrentRevision();
        }
        assert currentBranch != null : "Current branch is neither a named branch nor a revision";

        final GitCommitCompareInfo compareInfo = gerritGitUtil.loadCommitsToCompare(repositoriesFromRoots, branchName, project);
        new GitCompareBranchesDialog(project, branchName, currentBranchName, compareInfo, gitRepository).show();
View Full Code Here

Examples of git4idea.repo.GitRepository

        protected void updateChangesBrowser() {
            getViewer().setEmptyText("Loading...");
            setChangesToDisplay(Collections.<Change>emptyList());
            Optional<GitRepository> gitRepositoryOptional = gerritGitUtil.getRepositoryForGerritProject(project, selectedChange.project);
            if (!gitRepositoryOptional.isPresent()) return;
            final GitRepository gitRepository = gitRepositoryOptional.get();
            final VirtualFile virtualFile = gitRepository.getGitDir();
            final FilePathImpl filePath = new FilePathImpl(virtualFile);

            Map<String, RevisionInfo> revisions = selectedChange.revisions;
            final String revisionId = selectedRevisions.get(selectedChange);
            RevisionInfo currentRevision = revisions.get(revisionId);
View Full Code Here

Examples of git4idea.repo.GitRepository

    private GerritGitUtil gerritGitUtil;

    public String getRelativePath(Project project, String absoluteFilePath, String gerritProjectName) {
        Optional<GitRepository> gitRepositoryOptional = gerritGitUtil.getRepositoryForGerritProject(project, gerritProjectName);
        if (!gitRepositoryOptional.isPresent()) return null;
        GitRepository repository = gitRepositoryOptional.get();
        VirtualFile root = repository.getRoot();
        return FileUtil.getRelativePath(new File(root.getPath()), new File(absoluteFilePath));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.