示例#1
0
def test_linecolor_filelog():
    repo = openrepo('named-branch')
    grapher = graph.filelog_grapher(repo, 'data')
    actualtable = buildlinecolortable(grapher)
    expectedtable = {
        7: [0],  # |
        6: [0, 3, 2],  # | |\
        5: [0, 3, 2],  # | | |
        4: [0, 3, 2],  # | | |
        3: [2, 3, 2],  #  X /
        2: [3, 2],  # | |
        1: [3, 3],  # |/
        0: [],
    }
    assert_equal(expectedtable, actualtable)
示例#2
0
def test_linecolor_filelog():
    repo = openrepo('named-branch')
    grapher = graph.filelog_grapher(repo, 'data')
    actualtable = buildlinecolortable(grapher)
    expectedtable = {
        7: [0],        # |
        6: [0, 3, 2],  # | |\
        5: [0, 3, 2],  # | | |
        4: [0, 3, 2],  # | | |
        3: [2, 3, 2],  #  X /
        2: [3, 2],     # | |
        1: [3, 3],     # |/
        0: [],
        }
    assert_equal(expectedtable, actualtable)
示例#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 = []
示例#4
0
 def _createGraph(self):
     grapher = graph.filelog_grapher(self.repo, self._filename)
     return graph.Graph(self.repo, grapher)