Logo Search packages:      
Sourcecode: qbzr version File versions

def qbzr::lib::loggraphprovider::LogGraphProvider::load_branch_heads (   self  ) 

Load the tips, tips of the pending merges, and revision of the
working tree for each branch.

Definition at line 288 of file loggraphprovider.py.

00288                                :
        """Load the tips, tips of the pending merges, and revision of the
        working tree for each branch."""
        self.revid_head_info = {}
        self.head_revids = []
        self.revid_branch = {}
        for (tree, branch, index) in self.branches():
            if len(self.branches()) == 1:
                tag = None
                tag = branch.nick
                if len(tag) > 20:
                    tag = tag[:20]+'...'
            branch_last_revision = branch.last_revision()
            self.append_head_info(branch_last_revision, branch, tag, True)
            if tree:
                parent_ids = tree.get_parent_ids()
                if parent_ids:
                    # first parent is last revision of the tree
                    revid = parent_ids[0]
                    if revid != branch_last_revision:
                        # working tree is out of date
                        if tag:
                            self.append_head_info(revid, branch,
                                             "%s - Working Tree" % tag, False)
                            self.append_head_info(revid, branch,
                                             "Working Tree", False)
                    # other parents are pending merges
                    for revid in parent_ids[1:]:
                        if tag:
                            self.append_head_info(revid, branch,
                                             "%s - Pending Merge" % tag, False)
                            self.append_head_info(revid, branch,
                                             "Pending Merge", False)
        if len(self.branches())>1:
            if self.trunk_branch == None:
                # Work out which branch we think is trunk.
                # TODO: Make config option.
                trunk_names = "trunk,bzr.dev".split(",")
                for tree, branch, index in self.branches():
                    if branch.nick in trunk_names:
                        self.trunk_branch = branch
            if self.trunk_branch == None:
                self.trunk_branch = self.branches()[0][1]
            trunk_tip = self.trunk_branch.last_revision()
            def head_revids_cmp(x,y):
                if x == trunk_tip:
                    return -1
                if y == trunk_tip:
                    return 1
                return 0-cmp(self.revision(x).timestamp,
    def load_tags(self):

Generated by  Doxygen 1.6.0   Back to index