/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to viz/linegraph.py

  • Committer: Gary van der Merwe
  • Date: 2007-08-26 12:44:10 UTC
  • mto: (256.2.37 gtk)
  • mto: This revision was merged to the branch mainline in revision 289.
  • Revision ID: garyvdm@gmail.com-20070826124410-ohdwjod5g82p2cge
Use branch.revision_history as a mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
        if maxnum is not None and index > maxnum:
109
109
            break
110
110
    
111
 
    
 
111
    mainline = branch.revision_history()
112
112
    revisions = branch.repository.get_revisions(revids)
113
113
    revisionparents = branch.repository.get_graph().get_parents(revids)    
114
114
    directparentcache = [None for revision in revisions]
150
150
                          [], parents, children])
151
151
        
152
152
        branchlineid = None
153
 
        #Try and see if we are the same branchline as one of our children
154
 
        #If we are, use the same branchlineid
155
 
        for (childrevid, childindex, childbranchlineid) in children_ext: 
156
 
            childsparents = revisionparents[childindex]
157
 
            
158
 
            if len(children) == 1 and len(childsparents) == 1: 
159
 
                # one-one relationship between parent and child
160
 
                branchlineid = childbranchlineid
161
 
                break
162
 
            
163
 
            #Is the current revision the direct parent of the child?
164
 
            if revision.revision_id == \
165
 
                    getdirectparent(childrevid, childindex, childsparents):
166
 
                branchlineid = childbranchlineid
167
 
                break
 
153
        
 
154
        if revision.revision_id in mainline:
 
155
            branchlineid = 0
 
156
        else:
 
157
            #Try and see if we are the same branchline as one of our children
 
158
            #If we are, use the same branchlineid
 
159
            for (childrevid, childindex, childbranchlineid) in children_ext: 
 
160
                childsparents = revisionparents[childindex]
 
161
                
 
162
                if len(children) == 1 and len(childsparents) == 1: 
 
163
                    # one-one relationship between parent and child
 
164
                    branchlineid = childbranchlineid
 
165
                    break
 
166
                
 
167
                #Is the current revision the direct parent of the child?
 
168
                if childbranchlineid != 0 and revision.revision_id == \
 
169
                        getdirectparent(childrevid, childindex, childsparents):
 
170
                    branchlineid = childbranchlineid
 
171
                    break
168
172
        
169
173
        if branchlineid is None:
170
174
            branchlineid = lastbranchlineid = lastbranchlineid + 1