def test_revision_parsing(self):
        """Testing SVN (<backend>) revision number parsing"""
        self.assertEqual(
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'(working copy)'),
            (b'', HEAD))
        self.assertEqual(
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'   (revision 0)'),
            (b'', PRE_CREATION))

        self.assertEqual(
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'(revision 1)'),
            (b'', b'1'))
        self.assertEqual(
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'(revision 23)'),
            (b'', b'23'))

        # Fix for bug 2176
        self.assertEqual(
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'\t(revision 4)'),
            (b'', b'4'))

        self.assertEqual(
            self.tool.parse_diff_revision(
                filename=b'',
                revision=b'2007-06-06 15:32:23 UTC (rev 10958)'),
            (b'', b'10958'))

        # Fix for bug 2632
        self.assertEqual(
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'(revision )'),
            (b'', PRE_CREATION))

        with self.assertRaises(SCMError):
            self.tool.parse_diff_revision(filename=b'',
                                          revision=b'hello')

        # Verify that 'svn diff' localized revision strings parse correctly.
        self.assertEqual(
            self.tool.parse_diff_revision(
                filename=b'',
                revision='(revisión: 5)'.encode('utf-8')),
            (b'', b'5'))
        self.assertEqual(
            self.tool.parse_diff_revision(
                filename=b'',
                revision='(リビジョン 6)'.encode('utf-8')),
            (b'', b'6'))
        self.assertEqual(
            self.tool.parse_diff_revision(
                filename=b'',
                revision='(版本 7)'.encode('utf-8')),
            (b'', b'7'))