~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-22 08:44:52 UTC
  • mto: (5176.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5177.
  • Revision ID: v.ladeuil+lp@free.fr-20100422084452-pbumo8dq15o31yah
append_revisions_only accept all valid booleans, update doc to
warn about backward compatibility.

* bzrlib/tests/test_branch.py:
(TestBranchOptions.check_aro_is): Update warning message.
(TestBranchOptions.test_valid_append_revisions_only): More values
are accepted.
(TestBranchOptions.test_invalid_append_revisions_only): Less
values are invalid.

* bzrlib/tests/blackbox/test_init.py:
(TestSFTPInit.test_init_append_revisions_only): The default value
is now None.

* bzrlib/branch.py:
(BzrBranch8._get_append_revisions_only): Accept all valid booleans.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2689
2689
        return stacked_url
2690
2690
 
2691
2691
    def _get_append_revisions_only(self):
2692
 
        # if no option is found, then default to False.
2693
 
        # Since append_revisions_only can have negative consequences
2694
 
        # be very strict in interpreting the option value and default
2695
 
        # to False for compatibility.
2696
 
        name = 'append_revisions_only'
2697
 
        value = self.get_config().get_user_option(name)
2698
 
        if value is None:
2699
 
            return False
2700
 
        if value == 'True':
2701
 
            return True
2702
 
        if value == 'False':
2703
 
            return False
2704
 
        trace.warning('Value "%s" for append_revisions_only is neither True'
2705
 
                      ' nor False, defaulting to False', value)
2706
 
        return False
 
2692
        return self.get_config(
 
2693
            ).get_user_option_as_bool('append_revisions_only')
2707
2694
 
2708
2695
    @needs_write_lock
2709
2696
    def generate_revision_history(self, revision_id, last_rev=None,