comparison tests/test_push_command.py @ 557:d74bf020a61c

replay/stupid: raise the correct errno in IOError to fix hg >= e553a425751d Basically, all the IOErrors we ever raise inside a file commit function that is sent to commitctx should be ENOENT. This suggests a change should be made in commitctx to not overload IOError.
author Augie Fackler <durin42@gmail.com>
date Sun, 14 Feb 2010 14:04:56 -0600
parents 8522f8ef799e
children d96aa92d9ad9
comparison
equal deleted inserted replaced
556:8522f8ef799e 557:d74bf020a61c
53 53
54 def test_cant_push_with_changes(self): 54 def test_cant_push_with_changes(self):
55 repo = self.repo 55 repo = self.repo
56 def file_callback(repo, memctx, path): 56 def file_callback(repo, memctx, path):
57 return context.memfilectx( 57 return context.memfilectx(
58 path=path, data='foo', islink=False, 58 path=path, data='foo', islink=False,
59 isexec=False, copied=False) 59 isexec=False, copied=False)
60 ctx = context.memctx(repo, 60 ctx = context.memctx(repo,
61 (repo['default'].node(), node.nullid), 61 (repo['default'].node(), node.nullid),
62 'automated test', 62 'automated test',
63 ['adding_file'], 63 ['adding_file'],
300 self.assertNotEqual(oldnode, self.repo['tip'].hex(), 'Revision was not pushed.') 300 self.assertNotEqual(oldnode, self.repo['tip'].hex(), 'Revision was not pushed.')
301 301
302 def test_delete_file(self): 302 def test_delete_file(self):
303 repo = self.repo 303 repo = self.repo
304 def file_callback(repo, memctx, path): 304 def file_callback(repo, memctx, path):
305 raise IOError(errno.EBADF, 'Operation on deleted file attempted') 305 raise IOError(errno.ENOENT, '%s is deleted' % path)
306 old_files = set(repo['default'].manifest().keys()) 306 old_files = set(repo['default'].manifest().keys())
307 ctx = context.memctx(repo, 307 ctx = context.memctx(repo,
308 (repo['default'].node(), node.nullid), 308 (repo['default'].node(), node.nullid),
309 'automated test', 309 'automated test',
310 ['alpha'], 310 ['alpha'],