~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: John Arbash Meinel
  • Date: 2010-09-25 20:08:01 UTC
  • mfrom: (5444 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5445.
  • Revision ID: john@arbash-meinel.com-20100925200801-7uf0ux3uwxo9i3x0
Merge bzr.dev 5444 to resolve some small text conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    bzrdir,
30
30
    config,
31
31
    errors,
 
32
    symbol_versioning,
32
33
    tests,
33
34
    trace,
34
35
    transport,
86
87
        self.assertIsDirectory('.bzr/branch/lock/held', t)
87
88
 
88
89
    def test_set_push_location(self):
89
 
        from bzrlib.config import (locations_config_filename,
90
 
                                   ensure_config_dir_exists)
91
 
        ensure_config_dir_exists()
92
 
        fn = locations_config_filename()
93
 
        # write correct newlines to locations.conf
94
 
        # by default ConfigObj uses native line-endings for new files
95
 
        # but uses already existing line-endings if file is not empty
96
 
        f = open(fn, 'wb')
97
 
        try:
98
 
            f.write('# comment\n')
99
 
        finally:
100
 
            f.close()
 
90
        conf = config.LocationConfig.from_string('# comment\n', '.', save=True)
101
91
 
102
92
        branch = self.make_branch('.', format='knit')
103
93
        branch.set_push_location('foo')
106
96
                             "[%s]\n"
107
97
                             "push_location = foo\n"
108
98
                             "push_location:policy = norecurse\n" % local_path,
109
 
                             fn)
 
99
                             config.locations_config_filename())
110
100
 
111
101
    # TODO RBC 20051029 test getting a push location from a branch in a
112
102
    # recursive section - that is, it appends the branch name.
633
623
        # this usage of results is not recommended for new code (because it
634
624
        # doesn't describe very well what happened), but for api stability
635
625
        # it's still supported
636
 
        a = "%d revisions pulled" % r
637
 
        self.assertEqual(a, "10 revisions pulled")
 
626
        self.assertEqual(self.applyDeprecated(
 
627
            symbol_versioning.deprecated_in((2, 3, 0)),
 
628
            r.__int__),
 
629
            10)
638
630
 
639
631
    def test_report_changed(self):
640
632
        r = _mod_branch.PullResult()