~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-10 16:25:28 UTC
  • mfrom: (5020.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100210162528-00g29u0ex6vzv914
(gerard) Update performs two merges in a more logical order but stop
        on conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
36
36
from bzrlib.inventory import InventoryFile
37
37
from bzrlib.inter import InterObject
38
38
from bzrlib.osutils import fingerprint_file
 
39
import bzrlib.revision
39
40
from bzrlib.symbol_versioning import deprecated_function, deprecated_in
40
41
from bzrlib.trace import note
41
42
 
97
98
    def iter_changes(self, from_tree, include_unchanged=False,
98
99
                     specific_files=None, pb=None, extra_trees=None,
99
100
                     require_versioned=True, want_unversioned=False):
100
 
        """See InterTree.iter_changes"""
101
101
        intertree = InterTree.get(from_tree, self)
102
102
        return intertree.iter_changes(include_unchanged, specific_files, pb,
103
103
            extra_trees, require_versioned, want_unversioned=want_unversioned)
404
404
            bit_iter = iter(path.split("/"))
405
405
            for elt in bit_iter:
406
406
                lelt = elt.lower()
407
 
                new_path = None
408
407
                for child in self.iter_children(cur_id):
409
408
                    try:
410
 
                        # XXX: it seem like if the child is known to be in the
411
 
                        # tree, we shouldn't need to go from its id back to
412
 
                        # its path -- mbp 2010-02-11
413
 
                        #
414
 
                        # XXX: it seems like we could be more efficient
415
 
                        # by just directly looking up the original name and
416
 
                        # only then searching all children; also by not
417
 
                        # chopping paths so much. -- mbp 2010-02-11
418
409
                        child_base = os.path.basename(self.id2path(child))
419
 
                        if (child_base == elt):
420
 
                            # if we found an exact match, we can stop now; if
421
 
                            # we found an approximate match we need to keep
422
 
                            # searching because there might be an exact match
423
 
                            # later.  
 
410
                        if child_base.lower() == lelt:
424
411
                            cur_id = child
425
 
                            new_path = osutils.pathjoin(cur_path, child_base)
 
412
                            cur_path = osutils.pathjoin(cur_path, child_base)
426
413
                            break
427
 
                        elif child_base.lower() == lelt:
428
 
                            cur_id = child
429
 
                            new_path = osutils.pathjoin(cur_path, child_base)
430
414
                    except NoSuchId:
431
415
                        # before a change is committed we can see this error...
432
416
                        continue
433
 
                if new_path:
434
 
                    cur_path = new_path
435
417
                else:
436
418
                    # got to the end of this directory and no entries matched.
437
419
                    # Return what matched so far, plus the rest as specified.
520
502
            parent_keys = [(file_id, self._file_revision(t, file_id)) for t in
521
503
                self._iter_parent_trees()]
522
504
            vf.add_lines((file_id, last_revision), parent_keys,
523
 
                         self.get_file_lines(file_id))
 
505
                         self.get_file(file_id).readlines())
524
506
            repo = self.branch.repository
525
507
            base_vf = repo.texts
526
508
        else:
582
564
            yield child.file_id
583
565
 
584
566
    def lock_read(self):
585
 
        """Lock this tree for multiple read only operations.
586
 
        
587
 
        :return: A bzrlib.lock.LogicalLockResult.
588
 
        """
589
567
        pass
590
568
 
591
569
    def revision_tree(self, revision_id):
1130
1108
            if file_id in to_paths:
1131
1109
                # already returned
1132
1110
                continue
1133
 
            if not self.target.has_id(file_id):
 
1111
            if file_id not in self.target.all_file_ids():
1134
1112
                # common case - paths we have not emitted are not present in
1135
1113
                # target.
1136
1114
                to_path = None