~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/conflicts.py

  • Committer: Martin Pool
  • Date: 2006-04-12 06:06:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1656.
  • Revision ID: mbp@sourcefrog.net-20060412060637-11b65bc78d065a45
Improved bzr resolve command line handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    takes_options = [Option('all', help='Resolve all conflicts in this tree')]
75
75
    def run(self, file_list=None, all=False):
76
76
        from bzrlib.workingtree import WorkingTree
77
 
        if file_list is None:
78
 
            if not all:
79
 
                raise BzrCommandError(
80
 
                    "command 'resolve' needs one or more FILE, or --all")
 
77
        if all:
 
78
            if file_list:
 
79
                raise BzrCommandError("If --all is specified, no FILE may be provided")
 
80
            tree = WorkingTree.open_containing('.')[0]
 
81
            resolve(tree)
81
82
        else:
82
 
            if all:
83
 
                raise BzrCommandError(
84
 
                    "If --all is specified, no FILE may be provided")
85
 
                # XXX: arguably this should take a directory and mark as
86
 
                # resolved everything within it?
87
 
        tree = WorkingTree.open_containing(file_list[0])[0]
88
 
        resolve(tree, [tree.relpath(p) for p in file_list])
 
83
            if file_list is None:
 
84
                raise BzrCommandError("command 'resolve' needs one or more FILE, or --all")
 
85
            tree = WorkingTree.open_containing(file_list[0])[0]
 
86
            to_resolve = [tree.relpath(p) for p in file_list]
 
87
            resolve(tree, to_resolve)
89
88
 
90
89
 
91
90
def resolve(tree, paths=None, ignore_misses=False):