comparison tests/test_push_command.py @ 220:06eb60f9a026

push: Do not attempt to push empty revisions.
author Augie Fackler <durin42@gmail.com>
date Sat, 28 Mar 2009 17:50:00 -0500
parents 58ae90a65f41
children 4950b18cf949
comparison
equal deleted inserted replaced
219:794f473b9b49 220:06eb60f9a026
85 test_util.TestBase.setUp(self) 85 test_util.TestBase.setUp(self)
86 test_util.load_fixture_and_fetch('simple_branch.svndump', 86 test_util.load_fixture_and_fetch('simple_branch.svndump',
87 self.repo_path, 87 self.repo_path,
88 self.wc_path) 88 self.wc_path)
89 89
90 def test_cant_push_empty_ctx(self):
91 repo = self.repo
92 def file_callback(repo, memctx, path):
93 if path == 'adding_file':
94 return context.memfilectx(path=path,
95 data='foo',
96 islink=False,
97 isexec=False,
98 copied=False)
99 raise IOError()
100 ctx = context.memctx(repo,
101 (repo['default'].node(), node.nullid),
102 'automated test',
103 [],
104 file_callback,
105 'an_author',
106 '2008-10-07 20:59:48 -0500',
107 {'branch': 'default',})
108 new_hash = repo.commitctx(ctx)
109 hg.update(repo, repo['tip'].node())
110 old_tip = repo['tip'].node()
111 self.pushrevisions()
112 tip = self.repo['tip']
113 self.assertEqual(tip.node(), old_tip)
114
115
90 def test_push_to_default(self, commit=True): 116 def test_push_to_default(self, commit=True):
91 repo = self.repo 117 repo = self.repo
92 old_tip = repo['tip'].node() 118 old_tip = repo['tip'].node()
93 expected_parent = repo['default'].node() 119 expected_parent = repo['default'].node()
94 def file_callback(repo, memctx, path): 120 def file_callback(repo, memctx, path):