~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Robert Collins
  • Date: 2005-09-28 05:50:54 UTC
  • mfrom: (201)
  • mto: (147.2.6) (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: robertc@robertcollins.net-20050928055054-dbbd7d7169db3a72
merge from abentley

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
bzrlib.commands.OPTIONS['no-collapse'] = None
34
34
bzrlib.commands.OPTIONS['no-antialias'] = None
 
35
bzrlib.commands.OPTIONS['cluster'] = None
 
36
bzrlib.commands.OPTIONS['merge-branch'] = str
35
37
 
36
38
class cmd_graph_ancestry(bzrlib.commands.Command):
37
39
    """Produce ancestry graphs using dot.
40
42
    common output formats are png, gif, svg, ps.  An extension of '.dot' will
41
43
    cause a dot graph file to be produced.
42
44
 
43
 
    Ancestry is usually collapsed by removing nodes with a single parent
44
 
    and descendant, but this can be disabled with --no-collapse.
45
 
 
46
 
    The current branch's revisions are yellow and labeled R?, where ? is
47
 
    the revno.  Other revisions are labeled with essentially random numbers.
48
 
 
49
 
    Revisions that are not in branch storage have dotted outlines.
50
 
 
51
 
    rsvg is used to antialias PNG and JPEG output, but this can be disabled
52
 
    with --no-antialias.
 
45
    Branches are labeled r?, where ? is the revno.  If they have no revno,
 
46
    with the last 5 characters of their revision identifier are used instead.
 
47
    
 
48
    If --merge-branch is specified, the two branches are compared and a merge
 
49
    base is selected.
 
50
    
 
51
    Legend:
 
52
    white    normal revision
 
53
    yellow   THIS  history
 
54
    red      OTHER history
 
55
    orange   COMMON history
 
56
    blue     COMMON non-history ancestor
 
57
    dotted   Missing from branch storage
 
58
 
 
59
    Ancestry is usually collapsed by removing revisions with a single parent
 
60
    and descendant.  The number of skipped revisions is shown on the arrow.
 
61
    This feature can be disabled with --no-collapse.
 
62
 
 
63
    By default, revisions are ordered by distance from root, but they can be
 
64
    clustered instead using --cluster.
 
65
 
 
66
    If available, rsvg is used to antialias PNG and JPEG output, but this can
 
67
    be disabled with --no-antialias.
53
68
    """
54
69
    takes_args = ['branch', 'file']
55
 
    takes_options = ['no-collapse', 'no-antialias']
56
 
    def run(self, branch, file, no_collapse=False, no_antialias=False):
 
70
    takes_options = ['no-collapse', 'no-antialias', 'merge-branch', 'cluster']
 
71
    def run(self, branch, file, no_collapse=False, no_antialias=False,
 
72
        merge_branch=None, cluster=False):
57
73
        import graph
 
74
        if cluster:
 
75
            ranking = "cluster"
 
76
        else:
 
77
            ranking = "forced"
58
78
        graph.write_ancestry_file(branch, file, not no_collapse, 
59
 
                                  not no_antialias)
 
79
                                  not no_antialias, merge_branch, ranking)
60
80
 
61
81
class cmd_fetch_missing(bzrlib.commands.Command):
62
82
    """Attempt to retrieve missing ancestors from another branch.
75
95
    def run(self, filename=None, strip=0):
76
96
        from patch import patch
77
97
        from bzrlib.branch import Branch
78
 
        b = Branch('.', find_root=True)
 
98
        b = Branch.open_containing('.')
79
99
        return patch(b, filename, strip)
80
100
 
81
101