/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-14 22:53:25 UTC
  • mfrom: (1920 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1923.
  • Revision ID: john@arbash-meinel.com-20060814225325-6626efb06d6d33e9
[merge] bzr.dev 1920

Show diffs side-by-side

added added

removed removed

Lines of Context:
857
857
        if to_dir_id == None and to_name != '':
858
858
            raise BzrError("destination %r is not a versioned directory" % to_name)
859
859
        to_dir_ie = inv[to_dir_id]
860
 
        if to_dir_ie.kind not in ('directory', 'root_directory'):
 
860
        if to_dir_ie.kind != 'directory':
861
861
            raise BzrError("destination %r is not a directory" % to_abs)
862
862
 
863
863
        to_idpath = inv.get_idpath(to_dir_id)
1224
1224
        if new_revision is None:
1225
1225
            self.branch.set_revision_history([])
1226
1226
            return False
1227
 
        # current format is locked in with the branch
1228
 
        revision_history = self.branch.revision_history()
1229
1227
        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])
 
1228
            self.branch.generate_revision_history(new_revision)
 
1229
        except errors.NoSuchRevision:
 
1230
            # not present in the repo - dont try to set it deeper than the tip
 
1231
            self.branch.set_revision_history([new_revision])
1234
1232
        return True
1235
1233
 
1236
1234
    def _cache_basis_inventory(self, new_revision):
1259
1257
            path = self._basis_inventory_name()
1260
1258
            sio = StringIO(xml)
1261
1259
            self._control_files.put(path, sio)
1262
 
        except WeaveRevisionNotPresent:
 
1260
        except (errors.NoSuchRevision, errors.RevisionNotPresent):
1263
1261
            pass
1264
1262
 
1265
1263
    def read_basis_inventory(self):
1527
1525
                pass
1528
1526
            return False
1529
1527
        else:
1530
 
            try:
1531
 
                self.branch.revision_history().index(revision_id)
1532
 
            except ValueError:
1533
 
                raise errors.NoSuchRevision(self.branch, revision_id)
1534
1528
            self._control_files.put_utf8('last-revision', revision_id)
1535
1529
            return True
1536
1530