/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_revisionspec.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import datetime
18
18
import time
19
19
 
20
 
from bzrlib import (
 
20
from breezy import (
21
21
    errors,
22
22
    revision as _mod_revision,
23
23
    symbol_versioning,
24
24
    )
25
 
from bzrlib.tests import TestCaseWithTransport
26
 
from bzrlib.revisionspec import (
 
25
from breezy.tests import TestCaseWithTransport
 
26
from breezy.revisionspec import (
27
27
    RevisionInfo,
28
28
    RevisionSpec,
29
29
    RevisionSpec_dwim,
76
76
                      invalid_as_revision_id=True):
77
77
        try:
78
78
            self.get_in_history(revision_spec)
79
 
        except errors.InvalidRevisionSpec, e:
 
79
        except errors.InvalidRevisionSpec as e:
80
80
            self.assertEqual(revision_spec, e.spec)
81
81
            self.assertEqual(extra, e.extra)
82
82
        else:
86
86
            try:
87
87
                spec = RevisionSpec.from_string(revision_spec)
88
88
                spec.as_revision_id(self.tree.branch)
89
 
            except errors.InvalidRevisionSpec, e:
 
89
            except errors.InvalidRevisionSpec as e:
90
90
                self.assertEqual(revision_spec, e.spec)
91
91
                self.assertEqual(extra, e.extra)
92
92
            else:
215
215
            RevisionSpec_dwim._possible_revspecs = original_dwim_revspecs
216
216
        self.addCleanup(reset_dwim_revspecs)
217
217
        RevisionSpec_dwim.append_possible_lazy_revspec(
218
 
            "bzrlib.tests.test_revisionspec", "RevisionSpec_bork")
 
218
            "breezy.tests.test_revisionspec", "RevisionSpec_bork")
219
219
        self.assertAsRevisionId('r1', 'bork')
220
220
 
221
221
 
257
257
        # Get the right exception text
258
258
        try:
259
259
            int('X')
260
 
        except ValueError, e:
 
260
        except ValueError as e:
261
261
            pass
262
262
        self.assertInvalid('revno:X', extra='\n' + str(e))
263
263
 
268
268
    def test_invalid_number_with_branch(self):
269
269
        try:
270
270
            int('X')
271
 
        except ValueError, e:
 
271
        except ValueError as e:
272
272
            pass
273
273
        self.assertInvalid('revno:X:tree2', extra='\n' + str(e))
274
274
 
442
442
    def test_not_a_number(self):
443
443
        try:
444
444
            int('Y')
445
 
        except ValueError, e:
 
445
        except ValueError as e:
446
446
            pass
447
447
        self.assertInvalid('last:Y', extra='\n' + str(e))
448
448