/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/workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 18:38:57 UTC
  • mfrom: (1934 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1937.
  • Revision ID: john@arbash-meinel.com-20060816183857-7307edffa7098bd2
[merge] bzr.dev 1934

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
        self.branch.break_lock()
323
323
 
324
324
    def _set_inventory(self, inv):
 
325
        assert inv.root is not None
325
326
        self._inventory = inv
326
327
        self.path2id = self._inventory.path2id
327
328
 
399
400
            try:
400
401
                xml = self.read_basis_inventory()
401
402
                inv = bzrlib.xml5.serializer_v5.read_inventory_from_string(xml)
 
403
                inv.root.revision = revision_id
402
404
            except NoSuchFile:
403
405
                inv = None
404
406
            if inv is not None and inv.revision_id == revision_id:
857
859
        if to_dir_id == None and to_name != '':
858
860
            raise BzrError("destination %r is not a versioned directory" % to_name)
859
861
        to_dir_ie = inv[to_dir_id]
860
 
        if to_dir_ie.kind not in ('directory', 'root_directory'):
 
862
        if to_dir_ie.kind != 'directory':
861
863
            raise BzrError("destination %r is not a directory" % to_abs)
862
864
 
863
865
        to_idpath = inv.get_idpath(to_dir_id)
1224
1226
        if new_revision is None:
1225
1227
            self.branch.set_revision_history([])
1226
1228
            return False
1227
 
        # current format is locked in with the branch
1228
 
        revision_history = self.branch.revision_history()
1229
1229
        try:
1230
 
            position = revision_history.index(new_revision)
1231
 
        except ValueError:
1232
 
            raise errors.NoSuchRevision(self.branch, new_revision)
1233
 
        self.branch.set_revision_history(revision_history[:position + 1])
 
1230
            self.branch.generate_revision_history(new_revision)
 
1231
        except errors.NoSuchRevision:
 
1232
            # not present in the repo - dont try to set it deeper than the tip
 
1233
            self.branch.set_revision_history([new_revision])
1234
1234
        return True
1235
1235
 
1236
1236
    def _cache_basis_inventory(self, new_revision):
1259
1259
            path = self._basis_inventory_name()
1260
1260
            sio = StringIO(xml)
1261
1261
            self._control_files.put(path, sio)
1262
 
        except WeaveRevisionNotPresent:
 
1262
        except (errors.NoSuchRevision, errors.RevisionNotPresent):
1263
1263
            pass
1264
1264
 
1265
1265
    def read_basis_inventory(self):
1527
1527
                pass
1528
1528
            return False
1529
1529
        else:
1530
 
            try:
1531
 
                self.branch.revision_history().index(revision_id)
1532
 
            except ValueError:
1533
 
                raise errors.NoSuchRevision(self.branch, revision_id)
1534
1530
            self._control_files.put_utf8('last-revision', revision_id)
1535
1531
            return True
1536
1532