comparison tests/test_push_command.py @ 65:b33940d54fe2

push: Fix missing directory creation for the case of a new dir inside a new dir.
author Augie Fackler <durin42@gmail.com>
date Sun, 09 Nov 2008 17:02:07 -0600
parents cc5ebdb1e8d4
children 072010a271c6
comparison
equal deleted inserted replaced
64:08be8ee73551 65:b33940d54fe2
326 svn_url='file://' + self.repo_path) 326 svn_url='file://' + self.repo_path)
327 tip = self.repo['tip'] 327 tip = self.repo['tip']
328 self.assertNotEqual(tip.node(), new_hash) 328 self.assertNotEqual(tip.node(), new_hash)
329 self.assertEqual(tip['newdir/gamma'].data(), 'foo') 329 self.assertEqual(tip['newdir/gamma'].data(), 'foo')
330 330
331 def test_push_with_new_subdir(self):
332 self.test_push_to_default(commit=True)
333 repo = self.repo
334 def file_callback(repo, memctx, path):
335 if path == 'newdir/subdir/gamma':
336 return context.memfilectx(path=path,
337 data='foo',
338 islink=False,
339 isexec=False,
340 copied=False)
341 raise IOError()
342 ctx = context.memctx(repo,
343 (repo['tip'].node(), node.nullid),
344 'message',
345 ['newdir/subdir/gamma', ],
346 file_callback,
347 'author',
348 '2008-10-29 21:26:00 -0500',
349 {'branch': 'default', })
350 new_hash = repo.commitctx(ctx)
351 hg.update(repo, repo['tip'].node())
352 push_cmd.push_revisions_to_subversion(ui.ui(), repo=self.repo,
353 hg_repo_path=self.wc_path,
354 svn_url='file://' + self.repo_path)
355 tip = self.repo['tip']
356 self.assertNotEqual(tip.node(), new_hash)
357 self.assertEqual(tip['newdir/subdir/gamma'].data(), 'foo')
358
359
331 def test_push_existing_file_newly_symlink(self): 360 def test_push_existing_file_newly_symlink(self):
332 self.test_push_existing_file_newly_execute(execute=False, 361 self.test_push_existing_file_newly_execute(execute=False,
333 link=True, 362 link=True,
334 expected_flags='l') 363 expected_flags='l')
335 364