~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Aaron Bentley
  • Date: 2007-02-12 23:01:49 UTC
  • mto: (2230.3.47 branch6)
  • mto: This revision was merged to the branch mainline in revision 2290.
  • Revision ID: abentley@panoramicfeedback.com-20070212230149-cdoq27bpnuilvljc
Rename strict_revision_history to append_revisions_only

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
        """Older format branches cannot bind or unbind."""
319
319
        raise errors.UpgradeRequired(self.base)
320
320
 
321
 
    def set_strict_history(self, strict):
322
 
        """Older format branches cannot have a strict history policy."""
 
321
    def set_append_revisions_only(self, enabled):
 
322
        """Older format branches are never restricted to append-only"""
323
323
        raise errors.UpgradeRequired(self.base)
324
324
 
325
325
    def last_revision(self):
1688
1688
 
1689
1689
    @needs_write_lock
1690
1690
    def set_last_revision(self, revision_id):
1691
 
        if self._get_strict_history():
 
1691
        if self._get_append_revisions_only():
1692
1692
            self._check_history_violation(revision_id)
1693
1693
        if revision_id is None:
1694
1694
            revision_id = 'null:'
1699
1699
        if last_revision is None:
1700
1700
            return
1701
1701
        if last_revision not in self._lefthand_history(revision_id):
1702
 
            raise errors.StrictHistoryViolation(self.base)
 
1702
            raise errors.AppendRevisionsOnlyViolation(self.base)
1703
1703
 
1704
1704
    @needs_read_lock
1705
1705
    def revision_history(self):
1798
1798
        """See Branch.get_old_bound_location"""
1799
1799
        return self._get_bound_location(False)
1800
1800
 
1801
 
    def set_strict_history(self, strict):
1802
 
        if strict:
 
1801
    def set_append_revisions_only(self, enabled):
 
1802
        if enabled:
1803
1803
            value = 'True'
1804
1804
        else:
1805
1805
            value = 'False'
1806
 
        self.get_config().set_user_option('strict_history', value)
 
1806
        self.get_config().set_user_option('append_revisions_only', value)
1807
1807
 
1808
 
    def _get_strict_history(self):
1809
 
        return self.get_config().get_user_option('strict_history') == 'True'
 
1808
    def _get_append_revisions_only(self):
 
1809
        value = self.get_config().get_user_option('append_revisions_only')
 
1810
        return value == 'True'
1810
1811
 
1811
1812
    def _synchronize_history(self, destination, revision_id):
1812
1813
        """Synchronize last revision and revision history between branches.