comparison tests/test_push_command.py @ 101:a3b717e4abf5

Cleanups based on pyflakes output.
author Augie Fackler <durin42@gmail.com>
date Fri, 21 Nov 2008 16:21:19 -0600
parents 6c9b7cf1c5aa
children 58ae90a65f41
comparison
equal deleted inserted replaced
100:91ce18fa0375 101:a3b717e4abf5
1 import os 1 import os
2 import socket 2 import socket
3 import subprocess 3 import subprocess
4 import tempfile
5 import unittest 4 import unittest
6 5
7 from mercurial import context 6 from mercurial import context
8 from mercurial import commands
9 from mercurial import hg 7 from mercurial import hg
10 from mercurial import node 8 from mercurial import node
11 from mercurial import ui 9 from mercurial import ui
12 from mercurial import revlog 10 from mercurial import revlog
13 11
298 self.assertEqual(tip.parents()[0]['alpha'].flags(), '') 296 self.assertEqual(tip.parents()[0]['alpha'].flags(), '')
299 self.assertEqual(tip['alpha'].flags(), expected_flags) 297 self.assertEqual(tip['alpha'].flags(), expected_flags)
300 # while we're here, double check pushing an already-executable file 298 # while we're here, double check pushing an already-executable file
301 # works 299 # works
302 repo = self.repo 300 repo = self.repo
303 def file_callback(repo, memctx, path): 301 def file_callback2(repo, memctx, path):
304 return context.memfilectx(path=path, 302 return context.memfilectx(path=path,
305 data='bar', 303 data='bar',
306 islink=link, 304 islink=link,
307 isexec=execute, 305 isexec=execute,
308 copied=False) 306 copied=False)
309 ctx = context.memctx(repo, 307 ctx = context.memctx(repo,
310 (repo['default'].node(), node.nullid), 308 (repo['default'].node(), node.nullid),
311 'message', 309 'message',
312 ['alpha', ], 310 ['alpha', ],
313 file_callback, 311 file_callback2,
314 'author', 312 'author',
315 '2008-1-1 00:00:00 -0500', 313 '2008-1-1 00:00:00 -0500',
316 {'branch': 'default', }) 314 {'branch': 'default', })
317 new_hash = repo.commitctx(ctx) 315 new_hash = repo.commitctx(ctx)
318 hg.update(repo, repo['tip'].node()) 316 hg.update(repo, repo['tip'].node())
322 self.assertEqual(tip['alpha'].data(), 'bar') 320 self.assertEqual(tip['alpha'].data(), 'bar')
323 self.assertEqual(tip.parents()[0]['alpha'].flags(), expected_flags) 321 self.assertEqual(tip.parents()[0]['alpha'].flags(), expected_flags)
324 self.assertEqual(tip['alpha'].flags(), expected_flags) 322 self.assertEqual(tip['alpha'].flags(), expected_flags)
325 # now test removing the property entirely 323 # now test removing the property entirely
326 repo = self.repo 324 repo = self.repo
327 def file_callback(repo, memctx, path): 325 def file_callback3(repo, memctx, path):
328 return context.memfilectx(path=path, 326 return context.memfilectx(path=path,
329 data='bar', 327 data='bar',
330 islink=False, 328 islink=False,
331 isexec=False, 329 isexec=False,
332 copied=False) 330 copied=False)
333 ctx = context.memctx(repo, 331 ctx = context.memctx(repo,
334 (repo['default'].node(), node.nullid), 332 (repo['default'].node(), node.nullid),
335 'message', 333 'message',
336 ['alpha', ], 334 ['alpha', ],
337 file_callback, 335 file_callback3,
338 'author', 336 'author',
339 '2008-01-01 00:00:00 -0500', 337 '2008-01-01 00:00:00 -0500',
340 {'branch': 'default', }) 338 {'branch': 'default', })
341 new_hash = repo.commitctx(ctx) 339 new_hash = repo.commitctx(ctx)
342 hg.update(repo, repo['tip'].node()) 340 hg.update(repo, repo['tip'].node())