comparison tests/test_push_dirs.py @ 730:efb87d5bb311

subvertpy: fix bug with pushing changes to stuff in subdirs Seems one needs to call direditor.open_file(path) with a full path, not one that is relative to the direditor's directory.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Thu, 23 Sep 2010 13:50:17 +0200
parents 04b3f476e2c3
children de036c2cb36a
comparison
equal deleted inserted replaced
729:467b95348e6a 730:efb87d5bb311
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
4 8
5 class TestPushDirectories(test_util.TestBase): 9 class TestPushDirectories(test_util.TestBase):
6 def test_push_dirs(self): 10 def test_push_dirs(self):
7 self._load_fixture_and_fetch('emptyrepo.svndump') 11 self._load_fixture_and_fetch('emptyrepo.svndump')
8 12
77 ] 81 ]
78 self.commitchanges(changes) 82 self.commitchanges(changes)
79 self.pushrevisions() 83 self.pushrevisions()
80 self.assertEqual(self.svnls('project/trunk'), ['a' ,]) 84 self.assertEqual(self.svnls('project/trunk'), ['a' ,])
81 85
86 def test_push_single_dir_change_in_subdir(self):
87 # Tests simple pushing from default branch to a single dir repo
88 # Changes a file in a subdir (regression).
89 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
90 stupid=False,
91 layout='single',
92 subdir='tags')
93 def file_callback(repo, memctx, path):
94 return context.memfilectx(path=path,
95 data='foo',
96 islink=False,
97 isexec=False,
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()
82 110
83 def suite(): 111 def suite():
84 all = [unittest.TestLoader().loadTestsFromTestCase(TestPushDirectories), 112 all = [unittest.TestLoader().loadTestsFromTestCase(TestPushDirectories),
85 ] 113 ]
86 return unittest.TestSuite(all) 114 return unittest.TestSuite(all)