comparison tests/test_push_dirs.py @ 731:de036c2cb36a

test_push_dirs: use common commit-building infrastructure
author Augie Fackler <durin42@gmail.com>
date Sat, 02 Oct 2010 17:44:08 -0500
parents efb87d5bb311
children e9af7eba88db
comparison
equal deleted inserted replaced
730:efb87d5bb311 731:de036c2cb36a
1 import test_util 1 import test_util
2 2
3 import unittest 3 import unittest
4
5 from mercurial import context
6 from mercurial import hg
7 from mercurial import node
8 4
9 class TestPushDirectories(test_util.TestBase): 5 class TestPushDirectories(test_util.TestBase):
10 def test_push_dirs(self): 6 def test_push_dirs(self):
11 self._load_fixture_and_fetch('emptyrepo.svndump') 7 self._load_fixture_and_fetch('emptyrepo.svndump')
12 8
88 # Changes a file in a subdir (regression). 84 # Changes a file in a subdir (regression).
89 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 85 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
90 stupid=False, 86 stupid=False,
91 layout='single', 87 layout='single',
92 subdir='tags') 88 subdir='tags')
93 def file_callback(repo, memctx, path): 89 changes = [('tag_r3/alpha', 'tag_r3/alpha', 'foo'),
94 return context.memfilectx(path=path, 90 ('tag_r3/new', 'tag_r3/new', 'foo'),
95 data='foo', 91 ('new_dir/new', 'new_dir/new', 'foo'),
96 islink=False, 92 ]
97 isexec=False, 93 self.commitchanges(changes)
98 copied=False)
99 ctx = context.memctx(repo,
100 (repo['tip'].node(), node.nullid),
101 'automated test',
102 ['tag_r3/alpha', 'tag_r3/new', 'new_dir/new'],
103 file_callback,
104 'an_author',
105 '2009-10-19 18:49:30 -0500',
106 {'branch': 'default',})
107 repo.commitctx(ctx)
108 hg.update(repo, repo['tip'].node())
109 self.pushrevisions() 94 self.pushrevisions()
95 self.assertEqual(self.svnls('tags'),
96 ['copied_tag',
97 'copied_tag/alpha',
98 'copied_tag/beta',
99 'new_dir',
100 'new_dir/new',
101 'tag_r3',
102 'tag_r3/alpha',
103 'tag_r3/beta',
104 'tag_r3/new'])
110 105
111 def suite(): 106 def suite():
112 all = [unittest.TestLoader().loadTestsFromTestCase(TestPushDirectories), 107 all = [unittest.TestLoader().loadTestsFromTestCase(TestPushDirectories),
113 ] 108 ]
114 return unittest.TestSuite(all) 109 return unittest.TestSuite(all)