/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/tests/per_repository/test_revision.py

  • Committer: Andrew Bennetts
  • Date: 2010-04-13 04:33:55 UTC
  • mfrom: (5147 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5149.
  • Revision ID: andrew.bennetts@canonical.com-20100413043355-lg3id0uwtju0k3zs
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for revision properties."""
18
18
 
31
31
                     condiment='orange\n  mint\n\tcandy',
32
32
                     empty='',
33
33
                     non_ascii=u'\xb5')
34
 
        wt.commit(message='initial null commit', 
 
34
        wt.commit(message='initial null commit',
35
35
                 revprops=props,
36
36
                 allow_pointless=True,
37
37
                 rev_id='test@user-1')
38
38
        rev = b.repository.get_revision('test@user-1')
39
39
        self.assertTrue('flavor' in rev.properties)
40
40
        self.assertEquals(rev.properties['flavor'], 'choc-mint')
41
 
        self.assertEquals([('branch-nick', 'Nicholas'), 
 
41
        self.assertEquals([('branch-nick', 'Nicholas'),
42
42
                           ('condiment', 'orange\n  mint\n\tcandy'),
43
43
                           ('empty', ''),
44
44
                           ('flavor', 'choc-mint'),
50
50
        wt = self.make_branch_and_tree('.')
51
51
        b = wt.branch
52
52
        self.assertRaises(ValueError,
53
 
                          wt.commit, 
 
53
                          wt.commit,
54
54
                          message='invalid',
55
55
                          revprops={'what a silly property': 'fine'})
56
56
        self.assertRaises(ValueError,
57
 
                          wt.commit, 
 
57
                          wt.commit,
58
58
                          message='invalid',
59
59
                          revprops=dict(number=13))
60
60
 
63
63
    """Test that revision attributes are correct."""
64
64
 
65
65
    def test_revision_accessors(self):
66
 
        """Make sure the values that come out of a revision are the 
 
66
        """Make sure the values that come out of a revision are the
67
67
        same as the ones that go in.
68
68
        """
69
69
        tree1 = self.make_branch_and_tree("br1")
72
72
        tree1.commit(message="quux", allow_pointless=True, committer="jaq",
73
73
                     revprops={'empty':'',
74
74
                               'value':'one',
75
 
                               'unicode':'\xb5',
 
75
                               'unicode':u'\xb5',
76
76
                               'multiline':'foo\nbar\n\n'
77
77
                              })
78
78
        self.assertTrue(len(tree1.branch.revision_history()) > 0)
91
91
                     verbose=True)
92
92
        rev_b = tree2.branch.repository.get_revision(
93
93
                            tree2.branch.last_revision())
94
 
        
 
94
 
95
95
        self.assertEqual(rev_a.message, rev_b.message)
96
96
        self.assertEqual(rev_a.timestamp, rev_b.timestamp)
97
97
        self.assertEqual(rev_a.timezone, rev_b.timezone)