示例#1
0
 def setBranch(self, branch=None, allparents=False):
     self.filterbranch = branch  # unicode
     self.invalidateCache()
     if self.revset and self.filterbyrevset:
         grapher = revision_grapher(self.repo,
                                    branch=hglib.fromunicode(branch),
                                    revset=self.revset)
         self.graph = Graph(self.repo, grapher, include_mq=False)
     else:
         grapher = revision_grapher(self.repo,
                                    branch=hglib.fromunicode(branch),
                                    allparents=allparents)
         self.graph = Graph(self.repo, grapher, include_mq=True)
     self.rowcount = 0
     self.layoutChanged.emit()
     self.ensureBuilt(row=0)
     self.showMessage.emit('')
     QTimer.singleShot(0, lambda: self.filled.emit())
示例#2
0
 def _initGraph(self):
     branch = self.filterbranch
     allparents = self.allparents
     showhidden = self.showhidden
     self.invalidateCache()
     if self.revset and self.filterbyrevset:
         grapher = revision_grapher(self.repo,
                                    branch=hglib.fromunicode(branch),
                                    revset=self.revset,
                                    showhidden=showhidden)
         self.graph = Graph(self.repo, grapher, include_mq=False)
     else:
         grapher = revision_grapher(self.repo,
                                    branch=hglib.fromunicode(branch),
                                    allparents=allparents,
                                    showhidden=showhidden)
         self.graph = Graph(self.repo, grapher, include_mq=True)
     self.rowcount = 0
     self.layoutChanged.emit()
     self.ensureBuilt(row=0)
     self.showMessage.emit('')
     QTimer.singleShot(0, self, SIGNAL('filled()'))
示例#3
0
    def setFilename(self, filename):
        self.filename = filename

        self._user_colors = {}
        self._branch_colors = {}

        self.rowcount = 0
        self._datacache = {}

        if self.filename:
            grapher = filelog_grapher(self.repo, self.filename)
            self.graph = Graph(self.repo, grapher)
            fl = self.repo.file(self.filename)
            # we use fl.index here (instead of linkrev) cause
            # linkrev API changed between 1.0 and 1.?. So this
            # works with both versions.
            self.heads = [fl.index[fl.rev(x)][4] for x in fl.heads()]
            self.ensureBuilt(row=self.fill_step/2)
            QTimer.singleShot(0, self, SIGNAL('filled()'))
        else:
            self.graph = None
            self.heads = []