~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/conflicts.py

  • Committer: Andrew Bennetts
  • Date: 2010-09-17 04:35:23 UTC
  • mfrom: (5050.17.20 2.2)
  • mto: This revision was merged to the branch mainline in revision 5431.
  • Revision ID: andrew.bennetts@canonical.com-20100917043523-c5t63gmvxqxmqh5j
Merge lp:bzr/2.2, including fixes for #625574, #636930, #254278.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import errno
25
25
 
26
26
from bzrlib import (
27
 
    builtins,
28
27
    cleanup,
29
28
    commands,
30
29
    errors,
59
58
    Use bzr resolve when you have fixed a problem.
60
59
    """
61
60
    takes_options = [
 
61
            'directory',
62
62
            option.Option('text',
63
63
                          help='List paths of files with text conflicts.'),
64
64
        ]
65
65
    _see_also = ['resolve', 'conflict-types']
66
66
 
67
 
    def run(self, text=False):
68
 
        wt = workingtree.WorkingTree.open_containing(u'.')[0]
 
67
    def run(self, text=False, directory=u'.'):
 
68
        wt = workingtree.WorkingTree.open_containing(directory)[0]
69
69
        for conflict in wt.conflicts():
70
70
            if text:
71
71
                if conflict.typestring != 'text conflict':
112
112
    aliases = ['resolved']
113
113
    takes_args = ['file*']
114
114
    takes_options = [
 
115
            'directory',
115
116
            option.Option('all', help='Resolve all conflicts in this tree.'),
116
117
            ResolveActionOption(),
117
118
            ]
118
119
    _see_also = ['conflicts']
119
 
    def run(self, file_list=None, all=False, action=None):
 
120
    def run(self, file_list=None, all=False, action=None, directory=u'.'):
120
121
        if all:
121
122
            if file_list:
122
123
                raise errors.BzrCommandError("If --all is specified,"
123
124
                                             " no FILE may be provided")
124
 
            tree = workingtree.WorkingTree.open_containing('.')[0]
 
125
            tree = workingtree.WorkingTree.open_containing(directory)[0]
125
126
            if action is None:
126
127
                action = 'done'
127
128
        else:
128
 
            tree, file_list = builtins.tree_files(file_list)
 
129
            tree, file_list = workingtree.WorkingTree.open_containing_paths(
 
130
                file_list)
129
131
            if file_list is None:
130
132
                if action is None:
131
133
                    # FIXME: There is a special case here related to the option