~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to graph.py

  • Committer: Aaron Bentley
  • Date: 2006-02-01 03:37:33 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060201033733-df5441ce73162009
Got selftest passing with storage API

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from dotgraph import RSVG_OUTPUT_TYPES, DOT_OUTPUT_TYPES, Edge, invoke_dot_html
20
20
from bzrlib.branch import Branch
21
21
from bzrlib.errors import BzrCommandError, NoCommonRoot, NoSuchRevision
 
22
from bzrlib.fetch import greedy_fetch
22
23
from bzrlib.graph import node_distances, select_farthest
23
24
from bzrlib.revision import combined_graph, revision_graph
24
25
from bzrlib.revision import MultipleRevisionSources
111
112
        self.other_branch = other_branch
112
113
        revision_a = self.branch.last_revision()
113
114
        if other_branch is not None:
114
 
            branch.fetch(other_branch)
 
115
            greedy_fetch(branch, other_branch)
115
116
            revision_b = self.other_branch.last_revision()
116
117
            try:
117
118
                self.root, self.ancestors, self.descendants, self.common = \
118
 
                    combined_graph(revision_a, revision_b,
119
 
                                   self.branch.repository)
 
119
                    combined_graph(revision_a, revision_b, self.branch)
120
120
            except bzrlib.errors.NoCommonRoot:
121
121
                raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
122
122
        else:
123
123
            self.root, self.ancestors, self.descendants = \
124
 
                revision_graph(revision_a, branch.repository)
 
124
                revision_graph(revision_a, branch)
125
125
            self.common = []
126
126
 
127
127
        self.n_history = branch.revision_history()
174
174
            color = "#33ff99"
175
175
 
176
176
        label = [name]
177
 
        committer, message, date = get_rev_info(node, self.branch.repository)
 
177
        committer, message, date = get_rev_info(node, self.branch)
178
178
        if committer is not None:
179
179
            label.append(committer)
180
180
 
232
232
        m = Branch.open_containing(merge_branch)[0]
233
233
    else:
234
234
        m = None
235
 
    b.lock_write()
 
235
    b.lock_read()
236
236
    try:
237
237
        if m is not None:
238
238
            m.lock_read()
272
272
    elif ext == 'dot' and not done:
273
273
        my_file = file(filename, 'wb')
274
274
        for fragment in output:
275
 
            my_file.write(fragment.encode('utf-8'))
 
275
            my_file.write(fragment)
276
276
    elif ext == 'html':
277
277
        try:
278
278
            invoke_dot_html(output, filename)