~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-15 16:32:29 UTC
  • mfrom: (1731.1.67 unique-root)
  • Revision ID: pqm@pqm.ubuntu.com-20061015163229-648b1f2ebe692136
New trees have unique root ids

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib import bzrdir, errors
22
22
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
23
23
                           ReusingTransform, NotVersionedError, CantMoveRoot,
24
 
                           ExistingLimbo, ImmortalLimbo)
 
24
                           ExistingLimbo, ImmortalLimbo, NoFinalPath)
25
25
from bzrlib.inventory import InventoryEntry
26
26
from bzrlib.osutils import (file_kind, supports_executable, pathjoin, lexists,
27
27
                            delete_any)
457
457
        try:
458
458
            return self._new_name[trans_id]
459
459
        except KeyError:
460
 
            return os.path.basename(self._tree_id_paths[trans_id])
 
460
            try:
 
461
                return os.path.basename(self._tree_id_paths[trans_id])
 
462
            except KeyError:
 
463
                raise NoFinalPath(trans_id, self)
461
464
 
462
465
    def by_parent(self):
463
466
        """Return a map of parent: children for known parents.
570
573
            parent_id = trans_id
571
574
            while parent_id is not ROOT_PARENT:
572
575
                seen.add(parent_id)
573
 
                parent_id = self.final_parent(parent_id)
 
576
                try:
 
577
                    parent_id = self.final_parent(parent_id)
 
578
                except KeyError:
 
579
                    break
574
580
                if parent_id == trans_id:
575
581
                    conflicts.append(('parent loop', trans_id))
576
582
                if parent_id in seen:
958
964
    file_trans_id = {}
959
965
    top_pb = bzrlib.ui.ui_factory.nested_progress_bar()
960
966
    pp = ProgressPhase("Build phase", 2, top_pb)
 
967
    if tree.inventory.root is not None:
 
968
        wt.set_root_id(tree.inventory.root.file_id)
961
969
    tt = TreeTransform(wt)
962
970
    divert = set()
963
971
    try:
1232
1240
        basis_tree = None
1233
1241
        try:
1234
1242
            for id_num, file_id in enumerate(wt_interesting):
 
1243
                if (working_tree.inventory.is_root(file_id) and 
 
1244
                    len(target_tree.inventory) == 0):
 
1245
                    continue
1235
1246
                child_pb.update("New file check", id_num+1, 
1236
1247
                                len(sorted_interesting))
1237
1248
                if file_id not in target_tree: