28
28
import bzrlib.status
29
from bzrlib.branch import Branch
29
from bzrlib.commands import register_command
30
30
from bzrlib.errors import BzrCommandError, NotConflicted
31
from bzrlib.commands import register_command
32
from bzrlib.workingtree import CONFLICT_SUFFIXES
31
from bzrlib.option import Option
32
from bzrlib.workingtree import CONFLICT_SUFFIXES, WorkingTree
33
33
from bzrlib.osutils import rename
35
35
class cmd_conflicts(bzrlib.commands.Command):
36
36
"""List files with conflicts.
38
Merge will do its best to combine the changes in two branches, but there
39
are some kinds of problems only a human can fix. When it encounters those,
40
it will mark a conflict. A conflict means that you need to fix something,
41
before you should commit.
43
Use bzr resolve when you have fixed a problem.
37
45
(conflicts are determined by the presence of .BASE .TREE, and .OTHER
41
for path in Branch.open_containing(u'.')[0].working_tree().iter_conflicts():
51
for path in WorkingTree.open_containing(u'.')[0].iter_conflicts():
44
54
class cmd_resolve(bzrlib.commands.Command):
45
55
"""Mark a conflict as resolved.
57
Merge will do its best to combine the changes in two branches, but there
58
are some kinds of problems only a human can fix. When it encounters those,
59
it will mark a conflict. A conflict means that you need to fix something,
60
before you should commit.
62
Once you have fixed a problem, use "bzr resolve FILE.." to mark
63
individual files as fixed, or "bzr resolve --all" to mark all conflicts as
66
See also bzr conflicts.
47
68
aliases = ['resolved']
48
69
takes_args = ['file*']
49
takes_options = ['all']
70
takes_options = [Option('all', help='Resolve all conflicts in this tree')]
50
71
def run(self, file_list=None, all=False):
51
72
if file_list is None:
53
74
raise BzrCommandError(
54
75
"command 'resolve' needs one or more FILE, or --all")
55
tree = Branch.open_containing(u'.')[0].working_tree()
76
tree = WorkingTree.open_containing(u'.')[0]
56
77
file_list = list(tree.abspath(f) for f in tree.iter_conflicts())