~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2007-06-15 19:44:04 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070615194404-aftg1b9up4ve1t3y
Update graph-ancestry to support new graph API

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
    If available, rsvg is used to antialias PNG and JPEG output, but this can
156
156
    be disabled with --no-antialias.
157
157
    """
158
 
    takes_args = ['branch', 'file']
 
158
    takes_args = ['file', 'merge-branch?']
159
159
    takes_options = [Option('no-collapse', help="Do not skip simple nodes"),
160
160
                     Option('no-antialias',
161
161
                     help="Do not use rsvg to produce antialiased output"),
162
162
                     Option('merge-branch', type=str,
163
163
                     help="Use this branch to calcuate a merge base"),
164
164
                     Option('cluster', help="Use clustered output."),
165
 
                     Option('max-distance', help="Show no nodes farther than this",
166
 
                            type=int)]
167
 
    def run(self, branch, file, no_collapse=False, no_antialias=False,
168
 
        merge_branch=None, cluster=False, max_distance=None):
 
165
                     Option('max-distance',
 
166
                            help="Show no nodes farther than this", type=int),
 
167
                     Option('directory',
 
168
                            help='Source branch to use (default is current'
 
169
                            ' directory)',
 
170
                            short_name='d',
 
171
                            type=unicode),
 
172
                    ]
 
173
    def run(self, file, merge_branch, no_collapse=False, no_antialias=False,
 
174
        cluster=False, max_distance=100, directory='.'):
 
175
        if max_distance == -1:
 
176
            max_distance = None
169
177
        import graph
170
178
        if cluster:
171
179
            ranking = "cluster"
172
180
        else:
173
181
            ranking = "forced"
174
 
        graph.write_ancestry_file(branch, file, not no_collapse,
 
182
        graph.write_ancestry_file(directory, file, not no_collapse,
175
183
                                  not no_antialias, merge_branch, ranking,
176
184
                                  max_distance=max_distance)
177
185