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
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.
43
Ancestry is usually collapsed by removing nodes with a single parent
44
and descendant, but this can be disabled with --no-collapse.
46
The current branch's revisions are yellow and labeled R?, where ? is
47
the revno. Other revisions are labeled with essentially random numbers.
49
Revisions that are not in branch storage have dotted outlines.
51
rsvg is used to antialias PNG and JPEG output, but this can be disabled
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.
48
If --merge-branch is specified, the two branches are compared and a merge
56
blue COMMON non-history ancestor
57
dotted Missing from branch storage
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.
63
By default, revisions are ordered by distance from root, but they can be
64
clustered instead using --cluster.
66
If available, rsvg is used to antialias PNG and JPEG output, but this can
67
be disabled with --no-antialias.
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):
58
78
graph.write_ancestry_file(branch, file, not no_collapse,
79
not no_antialias, merge_branch, ranking)
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)