def historyChanged(self):
     if self.history.layername is not None:
         commitsAll, commitsDictAll, commitsLayer, commitsDictLayer = self.history.server.logAll(self.history.user, self.history.repo,
                                                                                         "master", self.history.layername)
         self.graph = CommitGraph(commitsAll, commitsDictAll, commitsLayer)            
     else:
         commits, commitsDict = self.history.server.log(self.history.user, self.history.repo, "master")
         self.graph = CommitGraph(commits, commitsDict)
     self.history.graph = self.graph
     self.history._updateContent()
Beispiel #2
0
 def showLayerExplorer(self):
     commitsAll, commitsDictAll, commitsLayer, commitsDictLayer = self.server.logAll(
         self.user, self.repo, "master", self.layer)
     graph = CommitGraph(commitsAll, commitsDictAll, commitsLayer)
     dialog = LayerExplorer(self.server, self.user, self.repo, graph,
                            self.layer)
     dialog.exec_()
Beispiel #3
0
 def showLog(self):
     commitsAll, commitsDictAll, commitsLayer, commitsDictLayer = self.server.logAll(
         self.user, self.repo, "master", self.layer)
     graph = CommitGraph(commitsAll, commitsDictAll, commitsLayer)
     dialog = HistoryDiffViewerDialog(self.server, self.user, self.repo,
                                      graph, self.layer)
     dialog.exec_()
 def showLog(self, layer=None):
     # import pydevd
     # pydevd.settrace('localhost', port=65432, stdoutToServer=True, stderrToServer=True,
     #                 trace_only_current_thread=False, overwrite_prev_trace=True, patch_multiprocessing=True,
     #                 suspend=False)
     #currentWindow().showMinimized()
     if layer is None:
         commits, commitsDict = self.repo.server.log(
             self.repo.ownerName, self.repo.repoName, "master")
         graph = CommitGraph(commits, commitsDict)
     else:
         commitsAll, commitsDictAll, commitsLayer, commitsDictLayer = self.repo.server.logAll(
             self.repo.ownerName, self.repo.repoName, "master", layer)
         graph = CommitGraph(commitsAll, commitsDictAll, commitsLayer)
     dialog = HistoryDiffViewerDialog(self.repo.server, self.repo.ownerName,
                                      self.repo.repoName, graph)
     dialog.exec_()
    def simplifyGraph(self, fullGraph):
        # find the set of commits to use
        # (either get all of them or just the layer-affecting sub-set
        mainCommitIds = fullGraph.importantCommitIds if fullGraph.importantCommitIds else fullGraph.commitIdList
        # we don't want merge commits - remove any that have multiple parents
        commits = [fullGraph.getById(id) for id in mainCommitIds]

        # re-parent the commits so the graph is a single verticle line (column 0)
        commits = [deepcopy(c.repo_json) for c in commits if len(c.parentIds) <=1]
        for idx,c in enumerate(commits):
            if idx != len(commits)-1:
                c["parentIds"] = [commits[idx+1]["id"]]
            else:
                pass # leave the parent commit here (its important that the system knows this isn't the first commit in the tree)

        commitids = [c["id"] for c in commits]
        commitDict = {c["id"]: c for c in commits}

        newGraph = CommitGraph(commitids,commitDict)
        newGraph.commitColumns = {c["id"]: 0 for c in commits} # shouldn't have to do this, but...
        return newGraph
Beispiel #6
0
    def fillWithPrData(self):
        if self.creatingPr:
            user2, repo2 = self.comboTarget.currentText().split(":")
            if self.tabWidget.count() > 2:
                self.tabWidget.removeTab(2)
                self.tabWidget.setCurrentIndex(0)  #summary
            commits, commitsDict = self.server.aheadCommits(
                self.user, self.repo, user2, repo2)
            user = self.user
            repo = self.repo
            user2, repo2 = self.comboTarget.currentText().split(":")
            behind, ahead = self.server.compareHistories(
                self.user, self.repo, user2, repo2)
            self.outOfSync = behind != 0
            self.inConflict = self.server.branchConflicts(
                self.user, self.repo, "master", user2, repo2, "master")

            self.fullDiffSummaryTotal, self.fullDiffSummary = self.server.diffSummary(
                user2, repo2, "HEAD", "HEAD", self.user, self.repo)
        else:
            pr = self.prs[self.comboPr.currentText()]
            self.prDescription = pr["description"] if pr[
                "description"] is not None else ""
            user = pr["sourceRepo"]["owner"]["identity"]
            repo = pr["sourceRepo"]["identity"]
            user2 = pr["targetRepo"]["owner"]["identity"]
            repo2 = pr["targetRepo"]["identity"]
            commits, commitsDict = self.server.aheadCommits(
                user, repo, user2, repo2)
            behind, ahead = self.server.compareHistories(
                user, repo, user2, repo2)
            self.outOfSync = behind != 0

            self.fullDiffSummaryTotal, self.fullDiffSummary = self.server.diffSummaryPR(
                self.user, self.repo, pr["id"])
            self.inConflict = self.fullDiffSummaryTotal is None
            self.tabWidget.setCurrentIndex(0)  # summary
            self.fullHistory = None

        if self.history is None:
            layout = QVBoxLayout()
            layout.setMargin(0)
            self.history = HistoryDiffViewerWidget(self,
                                                   self.server,
                                                   user,
                                                   repo,
                                                   CommitGraph(
                                                       commits, commitsDict),
                                                   initialSimplify=True)
            self.history.setShowPopup(False)
            layout.addWidget(self.history)
            self.tabWidget.widget(1).setLayout(layout)
        else:
            self.history.setContent(self.server, self.user, self.repo,
                                    CommitGraph(commits, commitsDict))

        self.setupInfo()
        self.buttonClose.setEnabled(self.belongsToLoggedUser)
        self.buttonCreate.setEnabled(len(commits) > 0)
        self.buttonMerge.setEnabled(
            len(commits) > 0 and self.belongsToLoggedUser)
        self.buttonTestMergeability.setEnabled(len(commits) > 0)
Beispiel #7
0
 def showLog(self):
     commits, commitsDict = self.server.log(self.user, self.repo, "master")
     graph = CommitGraph(commits, commitsDict)
     dialog = HistoryDiffViewerDialog(self.server, self.user, self.repo,
                                      graph)
     dialog.exec_()