/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: Canonical.com Patch Queue Manager
  • Date: 2006-08-07 22:37:14 UTC
  • mfrom: (1908.1.1 relax set_last_revision)
  • Revision ID: pqm@pqm.ubuntu.com-20060807223714-7e5db0e31c1ac094
(robertc) Loosen up the restrictions on WorkingTree.set_last_revision to setting it to nonexistant (i.e. ghosted) revisions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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