Mercurial > hgsubversion
comparison tests/test_push_command.py @ 1255:139a44a63090 stable 1.7
Merge default into stable for a release.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Wed, 05 Nov 2014 12:48:59 -0500 |
parents | f96e2495de39 |
children | a36e87ae2380 |
comparison
equal
deleted
inserted
replaced
1230:807c443928d4 | 1255:139a44a63090 |
---|---|
371 self.assertNotEqual(oldnode, self.repo['tip'].hex(), 'Revision was not pushed.') | 371 self.assertNotEqual(oldnode, self.repo['tip'].hex(), 'Revision was not pushed.') |
372 | 372 |
373 def test_delete_file(self): | 373 def test_delete_file(self): |
374 repo = self.repo | 374 repo = self.repo |
375 def file_callback(repo, memctx, path): | 375 def file_callback(repo, memctx, path): |
376 raise IOError(errno.ENOENT, '%s is deleted' % path) | 376 return compathacks.filectxfn_deleted(memctx, path) |
377 old_files = set(repo['default'].manifest().keys()) | 377 old_files = set(repo['default'].manifest().keys()) |
378 ctx = context.memctx(repo, | 378 ctx = context.memctx(repo, |
379 (repo['default'].node(), node.nullid), | 379 (repo['default'].node(), node.nullid), |
380 'automated test', | 380 'automated test', |
381 ['alpha'], | 381 ['alpha'], |
550 islink=link, | 550 islink=link, |
551 isexec=execute, | 551 isexec=execute, |
552 copied=False) | 552 copied=False) |
553 ctx = context.memctx(repo, | 553 ctx = context.memctx(repo, |
554 (repo['default'].node(), node.nullid), | 554 (repo['default'].node(), node.nullid), |
555 'message', | 555 'mutate already-special file alpha', |
556 ['alpha', ], | 556 ['alpha', ], |
557 file_callback2, | 557 file_callback2, |
558 'author', | 558 'author', |
559 '2008-1-1 00:00:00 -0500', | 559 '2008-1-1 00:00:00 -0500', |
560 {'branch': 'default', }) | 560 {'branch': 'default', }) |
575 islink=False, | 575 islink=False, |
576 isexec=False, | 576 isexec=False, |
577 copied=False) | 577 copied=False) |
578 ctx = context.memctx(repo, | 578 ctx = context.memctx(repo, |
579 (repo['default'].node(), node.nullid), | 579 (repo['default'].node(), node.nullid), |
580 'message', | 580 'convert alpha back to regular file', |
581 ['alpha', ], | 581 ['alpha', ], |
582 file_callback3, | 582 file_callback3, |
583 'author', | 583 'author', |
584 '2008-01-01 00:00:00 -0500', | 584 '2008-01-01 00:00:00 -0500', |
585 {'branch': 'default', }) | 585 {'branch': 'default', }) |
752 self.assertNotEqual(tip.node(), old_tip) | 752 self.assertNotEqual(tip.node(), old_tip) |
753 self.assertEqual(p, os.getcwd()) | 753 self.assertEqual(p, os.getcwd()) |
754 self.assertEqual(tip['adding_file'].data(), 'fooFirstFile') | 754 self.assertEqual(tip['adding_file'].data(), 'fooFirstFile') |
755 self.assertEqual(tip['newdir/new_file'].data(), 'fooNewFile') | 755 self.assertEqual(tip['newdir/new_file'].data(), 'fooNewFile') |
756 self.assertEqual(tip.branch(), 'default') | 756 self.assertEqual(tip.branch(), 'default') |
757 | |
758 def test_update_after_push(self): | |
759 repo = self.repo | |
760 ui = repo.ui | |
761 | |
762 ui.setconfig('hooks', | |
763 'debug-hgsubversion-between-push-and-pull-for-tests', | |
764 lambda ui, repo, hooktype: self.add_svn_rev( | |
765 self.repo_path, | |
766 {'trunk/racey_file': 'race conditions suck'})) | |
767 | |
768 self.test_push_to_branch(push=False) | |
769 commands.push(ui, repo) | |
770 newctx = self.repo['.'] | |
771 self.assertNotEqual(newctx.node(), self.repo['tip'].node()) | |
772 self.assertEqual(newctx['adding_file'].data(), 'foo') | |
773 self.assertEqual(newctx.branch(), 'the_branch') |