def test_missing_metadata(self):
        self._load_fixture_and_fetch('two_heads.svndump')
        os.remove(self.repo.join('svn/branch_info'))
        svncommands.updatemeta(self.ui(), self.repo, [])

        test_util.rmtree(self.repo.join('svn'))
        self.assertRaises(hgutil.Abort,
                          self.repo.svnmeta)
        self.assertRaises(hgutil.Abort,
                          svncommands.info,
                          self.ui(), repo=self.repo, args=[])
        self.assertRaises(hgutil.Abort,
                          svncommands.genignore,
                          self.ui(), repo=self.repo, args=[])

        os.remove(self.repo.join('hgrc'))
        self.assertRaises(hgutil.Abort,
                          self.repo.svnmeta)
        self.assertRaises(hgutil.Abort,
                          svncommands.info,
                          self.ui(), repo=self.repo, args=[])
        self.assertRaises(hgutil.Abort,
                          svncommands.genignore,
                          self.ui(), repo=self.repo, args=[])

        self.assertRaises(hgutil.Abort,
                          svncommands.rebuildmeta,
                          self.ui(), repo=self.repo, args=[])
    def test_empty_log_message(self):
        repo, repo_path = self.load_and_fetch('empty-log-message.svndump')

        self.assertEqual(repo['tip'].description(), '')

        test_util.rmtree(self.wc_path)

        ui = self.ui()
        ui.setconfig('hgsubversion', 'defaultmessage', 'blyf')
        commands.clone(ui, test_util.fileurl(repo_path), self.wc_path)

        self.assertEqual(self.repo['tip'].description(), 'blyf')
Exemple #3
0
    def test_empty_log_message(self):
        repo, repo_path = self.load_and_fetch('empty-log-message.svndump')

        self.assertEqual(revsymbol(repo, 'tip').description(), '')

        test_util.rmtree(self.wc_path)

        ui = self.ui()
        ui.setconfig('hgsubversion', 'defaultmessage', 'blyf')
        commands.clone(ui, test_util.fileurl(repo_path), self.wc_path)

        self.assertEqual(revsymbol(self.repo, 'tip').description(), 'blyf')
    def test_author_map_no_author(self):
        repo, repo_path = self.load_and_fetch('no-author.svndump')
        users = set(self.repo[r].user() for r in self.repo)
        expected_users = ['(no author)@%s' % self.repo.svnmeta().uuid]
        self.assertEqual(sorted(users), expected_users)
        test_util.rmtree(self.wc_path)

        authormap = open(self.authors, 'w')
        authormap.write("(no author)=Testy <*****@*****.**>")
        authormap.close()
        ui = self.ui()
        ui.setconfig('hgsubversion', 'authormap', self.authors)
        commands.clone(ui, test_util.fileurl(repo_path),
                       self.wc_path, authors=self.authors)
        users = set(self.repo[r].user() for r in self.repo)
        expected_users = ['Testy <*****@*****.**>']
        self.assertEqual(sorted(users), expected_users)
Exemple #5
0
    def test_author_map_no_author(self):
        repo, repo_path = self.load_and_fetch('no-author.svndump')
        users = set(self.repo[r].user() for r in self.repo)
        expected_users = ['(no author)@%s' % self.repo.svnmeta().uuid]
        self.assertEqual(sorted(users), expected_users)
        test_util.rmtree(self.wc_path)

        authormap = open(self.authors, 'w')
        authormap.write("(no author)=Testy <*****@*****.**>")
        authormap.close()
        ui = self.ui()
        ui.setconfig('hgsubversion', 'authormap', self.authors)
        commands.clone(ui,
                       test_util.fileurl(repo_path),
                       self.wc_path,
                       authors=self.authors)
        users = set(self.repo[r].user() for r in self.repo)
        expected_users = ['Testy <*****@*****.**>']
        self.assertEqual(sorted(users), expected_users)
    def test_missing_metadata(self):
        self._load_fixture_and_fetch('two_heads.svndump')
        os.remove(self.repo.vfs.join('svn/branch_info'))
        svncommands.updatemeta(self.ui(), self.repo, [])

        test_util.rmtree(self.repo.vfs.join('svn'))
        self.assertRaises(hgerror.Abort, self.repo.svnmeta)
        self.assertRaises(hgerror.Abort,
                          svncommands.info,
                          self.ui(),
                          repo=self.repo,
                          args=[])
        self.assertRaises(hgerror.Abort,
                          svncommands.genignore,
                          self.ui(),
                          repo=self.repo,
                          args=[])

        os.remove(self.repo.vfs.join('hgrc'))
        self.assertRaises(hgerror.Abort, self.repo.svnmeta)
        self.assertRaises(hgerror.Abort,
                          svncommands.info,
                          self.ui(),
                          repo=self.repo,
                          args=[])
        self.assertRaises(hgerror.Abort,
                          svncommands.genignore,
                          self.ui(),
                          repo=self.repo,
                          args=[])

        self.assertRaises(hgerror.Abort,
                          svncommands.rebuildmeta,
                          self.ui(),
                          repo=self.repo,
                          args=[])
Exemple #7
0
 def tearDown(self):
     del self.repo
     test_util.rmtree(self.tmpdir)
Exemple #8
0
 def tearDown(self):
     del self.repo
     test_util.rmtree(self.tmpdir)