~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to graph.py

  • Committer: Aaron Bentley
  • Date: 2005-11-10 20:15:27 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20051110201527-8caa84ae529a1871
Added Daniel Silverstone to credits

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#    You should have received a copy of the GNU General Public License
15
15
#    along with this program; if not, write to the Free Software
16
16
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 
from bzrtools import short_committer
18
17
from dotgraph import Node, dot_output, invoke_dot, invoke_dot_aa, NoDot, NoRsvg
19
18
from dotgraph import RSVG_OUTPUT_TYPES, DOT_OUTPUT_TYPES, Edge, invoke_dot_html
20
19
from bzrlib.branch import Branch
37
36
            }
38
37
 
39
38
committer_alias = {'abentley': 'Aaron Bentley'}
 
39
def short_committer(committer):
 
40
    new_committer = re.sub('<.*>', '', committer).strip(' ')
 
41
    if len(new_committer) < 2:
 
42
        return committer
 
43
    return new_committer
 
44
 
40
45
def can_skip(rev_id, descendants, ancestors):
41
46
    if rev_id not in descendants:
42
47
        return False
116
121
            revision_b = self.other_branch.last_revision()
117
122
            try:
118
123
                self.root, self.ancestors, self.descendants, self.common = \
119
 
                    combined_graph(revision_a, revision_b,
120
 
                                   self.branch.repository)
 
124
                    combined_graph(revision_a, revision_b, self.branch)
121
125
            except bzrlib.errors.NoCommonRoot:
122
126
                raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
123
127
        else:
124
128
            self.root, self.ancestors, self.descendants = \
125
 
                revision_graph(revision_a, branch.repository)
 
129
                revision_graph(revision_a, branch)
126
130
            self.common = []
127
131
 
128
132
        self.n_history = branch.revision_history()
175
179
            color = "#33ff99"
176
180
 
177
181
        label = [name]
178
 
        committer, message, date = get_rev_info(node, self.branch.repository)
 
182
        committer, message, date = get_rev_info(node, self.branch)
179
183
        if committer is not None:
180
184
            label.append(committer)
181
185
 
233
237
        m = Branch.open_containing(merge_branch)[0]
234
238
    else:
235
239
        m = None
236
 
    b.lock_write()
 
240
    b.lock_read()
237
241
    try:
238
242
        if m is not None:
239
243
            m.lock_read()