Beispiel #1
0
 def setBranch(self, branch=None, allparents=True):
     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())
Beispiel #2
0
 def _createGraph(self):
     opts = {
         'branch': hglib.fromunicode(self._filterbranch),
         'showgraftsource': self._showgraftsource,
         }
     if self._revspec and not self._selectedrevs and self._filterbyrevset:
         return graph.Graph(self.repo, [])  # no matches found
     if self._selectedrevs and self._filterbyrevset:
         opts['revset'] = self._selectedrevs
         opts['showfamilyline'] = \
             self.repo.ui.configbool('tortoisehg', 'showfamilyline', True)
         grapher = graph.revision_grapher(self.repo, opts)
         return graph.Graph(self.repo, grapher, include_mq=False)
     else:
         opts['allparents'] = self._allparents
         grapher = graph.revision_grapher(self.repo, opts)
         return graph.Graph(self.repo, grapher, include_mq=True)
Beispiel #3
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())
Beispiel #4
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()'))
Beispiel #5
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()'))
Beispiel #6
0
def test_linecolor_branchfiltered():
    repo = openrepo('named-branch')
    grapher = graph.revision_grapher(repo, branch='default')
    actualtable = buildlinecolortable(grapher)
    expectedtable = {
        7: [1],  # |
        6: [1, 2],  # | |
        5: [1, 2],  # | |
        4: [1, 1],  # | |
        3: [1, 1],  # |/
        1: [1],  # |
        0: [],
        9: [],  # TODO bug?
    }
    assert_equal(expectedtable, actualtable)
Beispiel #7
0
def test_linecolor_branchfiltered():
    repo = openrepo('named-branch')
    grapher = graph.revision_grapher(repo, branch='default')
    actualtable = buildlinecolortable(grapher)
    expectedtable = {
        7: [1],     # |
        6: [1, 2],  # | |
        5: [1, 2],  # | |
        4: [1, 1],  # | |
        3: [1, 1],  # |/
        1: [1],     # |
        0: [],
        9: [],  # TODO bug?
        }
    assert_equal(expectedtable, actualtable)
Beispiel #8
0
def test_linecolor_unfiltered():
    repo = openrepo('named-branch')
    grapher = graph.revision_grapher(repo)
    actualtable = buildlinecolortable(grapher)
    expectedtable = {
        None: [0],  # |
        8: [0, 2],  # |\
        7: [0, 2, 3],  # | | |
        6: [0, 0, 4, 3],  # |/| |
        5: [0, 4, 3],  # | | |
        4: [0, 3, 3],  # | | |
        3: [0, 3, 3],  # | |/
        2: [0, 3],  # | |
        1: [0, 0],  # |/
        0: [],
        9: [0],  # TODO bug?
    }
    assert_equal(expectedtable, actualtable)
Beispiel #9
0
def test_linecolor_unfiltered():
    repo = openrepo('named-branch')
    grapher = graph.revision_grapher(repo)
    actualtable = buildlinecolortable(grapher)
    expectedtable = {
        None: [0],        # |
        8: [0, 2],        # |\
        7: [0, 2, 3],     # | | |
        6: [0, 0, 4, 3],  # |/| |
        5: [0, 4, 3],     # | | |
        4: [0, 3, 3],     # | | |
        3: [0, 3, 3],     # | |/
        2: [0, 3],        # | |
        1: [0, 0],        # |/
        0: [],
        9: [0],  # TODO bug?
        }
    assert_equal(expectedtable, actualtable)