10
sys.path.append(os.path.dirname(__file__))
11
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__),
12
14
bzrlib.commands.OPTIONS['ignored'] = None
13
bzrlib.commands.OPTIONS['detrius'] = None
15
16
class cmd_clean_tree(bzrlib.commands.Command):
16
17
"""Remove unwanted files from working tree.
17
Normally, ignored files are left alone.
18
Normally, ignored files are left alone. The --ignored flag will cause them
19
to be deleted as well.
21
takes_options = ['ignored']
22
def run(self, ignored=False):
24
clean_tree.clean_tree(ignored=ignored)
20
--detrius Delete conflict files and merge backups. (*.THIS, *.BASE,
22
--ignored Delete all ignored files.
23
--dry-run Show files to delete instead of deleting them.
26
class cmd_conflicted(bzrlib.commands.Command):
27
"""List files that have conflicts
25
takes_options = ['ignored', 'detrius', 'dry-run']
26
def run(self, ignored=False, detrius=False, dry_run=False):
29
takes_options = ['ignored']
30
def run(self, ignored=False):
28
from bzrlib.branch import Branch
29
br = Branch.open_containing('.')
30
tree = br.working_tree()
31
deletables = clean_tree.iter_deletables(tree, ignored=ignored,
33
clean_tree.clean_tree(deletables, dry_run=dry_run)
32
clean_tree.clean_tree(ignored=ignored)
35
34
bzrlib.commands.OPTIONS['no-collapse'] = None
36
35
bzrlib.commands.OPTIONS['no-antialias'] = None
80
79
graph.write_ancestry_file(branch, file, not no_collapse,
81
80
not no_antialias, merge_branch, ranking)
83
class cmd_fetch_ghosts(bzrlib.commands.Command):
84
"""Attempt to retrieve ghosts from another branch.
82
class cmd_fetch_missing(bzrlib.commands.Command):
83
"""Attempt to retrieve missing ancestors from another branch.
85
84
If the other branch is not supplied, the last-pulled branch is used.
87
aliases = ['fetch-missing']
88
86
takes_args = ['branch?']
89
87
def run(self, branch=None):
90
from fetch_ghosts import fetch_ghosts
88
from fetch_missing import fetch_missing
93
91
class cmd_patch(bzrlib.commands.Command):
94
92
"""Apply a named patch to the current tree.
106
104
commands = [push.cmd_push, annotate.cmd_annotate, shelf.cmd_shelve,
107
shelf.cmd_unshelve, cmd_clean_tree, cmd_graph_ancestry,
108
cmd_fetch_ghosts, cmd_patch]
105
shelf.cmd_unshelve, cmd_clean_tree, conflicts.cmd_conflicts,
106
conflicts.cmd_resolve, cmd_graph_ancestry, cmd_fetch_missing,
109
108
from errors import NoPyBaz
111
110
import baz_import
111
commands.append(baz_import.cmd_baz_import_branch)
112
112
commands.append(baz_import.cmd_baz_import)
121
121
bzrlib.commands.register_command(command)
123
123
def test_suite():
124
126
from doctest import DocTestSuite
125
return DocTestSuite(bzrtools)
127
from unittest import TestSuite
129
result.addTest(DocTestSuite(bzrtools))
130
result.addTest(DocTestSuite(baz_import))
131
result.addTest(tests.test_suite())