comparison tests/test_utility_commands.py @ 746:174f03c288d4

svnmeta: abort when no UUID given and none is stored on disk. Previously, not passing a UUID when instantiating an SVNMeta instance would cause it to succeed even if no UUID was previously known. First when the UUID was actually read would an exception be raised. This slight refactoring of _set_uuid() makes it so an exception is raised immediately. While at it, the exception message is changed to be slightly more accurate and helpful.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 11 Nov 2010 21:32:22 +0100
parents 045120d3a110
children caa527346a0f
comparison
equal deleted inserted replaced
745:6252f0cc7b7a 746:174f03c288d4
7 from mercurial import hg 7 from mercurial import hg
8 from mercurial import revlog 8 from mercurial import revlog
9 from mercurial import context 9 from mercurial import context
10 from mercurial import node 10 from mercurial import node
11 from mercurial import commands 11 from mercurial import commands
12 from mercurial import util as hgutil
12 13
13 from hgsubversion import util 14 from hgsubversion import util
14 from hgsubversion import svncommands 15 from hgsubversion import svncommands
15 from hgsubversion import wrappers 16 from hgsubversion import wrappers
16 17
78 'repourl': self.repourl, 79 'repourl': self.repourl,
79 'branch': 'trunk', 80 'branch': 'trunk',
80 'rev': 6, 81 'rev': 6,
81 }) 82 })
82 self.assertMultiLineEqual(expected, actual) 83 self.assertMultiLineEqual(expected, actual)
84
85 def test_info_missing_metadata(self):
86 repo = self._load_fixture_and_fetch('two_heads.svndump')
87 test_util.rmtree(repo.join('svn'))
88 self.assertRaises(hgutil.Abort,
89 repo.svnmeta)
90 self.assertRaises(hgutil.Abort,
91 svncommands.info, self.ui, self.repo)
83 92
84 def test_parent_output(self): 93 def test_parent_output(self):
85 self._load_fixture_and_fetch('two_heads.svndump') 94 self._load_fixture_and_fetch('two_heads.svndump')
86 u = self.ui() 95 u = self.ui()
87 u.pushbuffer() 96 u.pushbuffer()