/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Robert Collins
  • Date: 2005-11-05 14:48:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1503.
  • Revision ID: robertc@robertcollins.net-20051105144839-0778253797be08ec
Replace the WorkingTree.revert method algorithm with a call to merge_inner.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.changeset import generate_changeset, ExceptionConflictHandler
28
28
from bzrlib.changeset import Inventory, Diff3Merge, ReplaceContents
29
29
from bzrlib.branch import Branch
30
 
from bzrlib.errors import BzrCommandError, UnrelatedBranches, NoCommonAncestor
31
 
from bzrlib.errors import NoCommits, WorkingTreeNotRevision, NotBranchError
 
30
from bzrlib.errors import (BzrCommandError,
 
31
                           UnrelatedBranches,
 
32
                           NoCommonAncestor,
 
33
                           NoCommits,
 
34
                           WorkingTreeNotRevision,
 
35
                           NotBranchError,
 
36
                           NotVersionedError)
32
37
from bzrlib.delta import compare_trees
33
38
from bzrlib.trace import mutter, warning, note
34
39
from bzrlib.fetch import greedy_fetch, fetch
347
352
    if interesting_files:
348
353
        assert not interesting_ids, ('Only supply interesting_ids'
349
354
                                     ' or interesting_files')
350
 
        merger.set_interesting_files(interesting_files)
 
355
        merger._set_interesting_files(interesting_files)
351
356
    merger.show_base = show_base 
352
357
    merger.reprocess = reprocess
353
358
    merger.conflict_handler = MergeConflictHandler(merger.this_tree, base_tree, 
436
441
            self.this_rev_id = self.this_basis
437
442
 
438
443
    def set_interesting_files(self, file_list):
 
444
        try:
 
445
            self._set_interesting_files(file_list)
 
446
        except NotVersionedError, e:
 
447
            raise BzrCommandError("%s is not a source file in any"
 
448
                                      " tree." % e.path)
 
449
 
 
450
    def _set_interesting_files(self, file_list):
 
451
        """Set the list of interesting ids from a list of files."""
439
452
        if file_list is None:
440
453
            self.interesting_ids = None
441
454
            return
450
463
                    interesting_ids.add(file_id)
451
464
                    found_id = True
452
465
            if not found_id:
453
 
                raise BzrCommandError("%s is not a source file in any"
454
 
                                      " tree." % fname)
 
466
                raise NotVersionedError(path=fname)
455
467
        self.interesting_ids = interesting_ids
456
468
 
457
469
    def set_pending(self):