~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/conflicts.py

Fix the remaining 'edge' references.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    Use bzr resolve when you have fixed a problem.
60
60
    """
61
61
    takes_options = [
 
62
            'directory',
62
63
            option.Option('text',
63
64
                          help='List paths of files with text conflicts.'),
64
65
        ]
65
66
    _see_also = ['resolve', 'conflict-types']
66
67
 
67
 
    def run(self, text=False):
68
 
        wt = workingtree.WorkingTree.open_containing(u'.')[0]
 
68
    def run(self, text=False, directory=u'.'):
 
69
        wt = workingtree.WorkingTree.open_containing(directory)[0]
69
70
        for conflict in wt.conflicts():
70
71
            if text:
71
72
                if conflict.typestring != 'text conflict':
112
113
    aliases = ['resolved']
113
114
    takes_args = ['file*']
114
115
    takes_options = [
 
116
            'directory',
115
117
            option.Option('all', help='Resolve all conflicts in this tree.'),
116
118
            ResolveActionOption(),
117
119
            ]
118
120
    _see_also = ['conflicts']
119
 
    def run(self, file_list=None, all=False, action=None):
 
121
    def run(self, file_list=None, all=False, action=None, directory=u'.'):
120
122
        if all:
121
123
            if file_list:
122
124
                raise errors.BzrCommandError("If --all is specified,"
123
125
                                             " no FILE may be provided")
124
 
            tree = workingtree.WorkingTree.open_containing('.')[0]
 
126
            tree = workingtree.WorkingTree.open_containing(directory)[0]
125
127
            if action is None:
126
128
                action = 'done'
127
129
        else:
598
600
        self._resolve_with_cleanups(tree, 'THIS')
599
601
 
600
602
 
601
 
# FIXME: TextConflict is about a single file-id, there never is a conflict_path
602
 
# attribute so we shouldn't inherit from PathConflict but simply from Conflict
603
 
 
604
603
# TODO: There should be a base revid attribute to better inform the user about
605
604
# how the conflicts were generated.
606
 
class TextConflict(PathConflict):
 
605
class TextConflict(Conflict):
607
606
    """The merge algorithm could not resolve all differences encountered."""
608
607
 
609
608
    has_files = True
612
611
 
613
612
    format = 'Text conflict in %(path)s'
614
613
 
 
614
    rformat = '%(class)s(%(path)r, %(file_id)r)'
 
615
 
615
616
    def associated_filenames(self):
616
617
        return [self.path + suffix for suffix in CONFLICT_SUFFIXES]
617
618