comparison tests/test-import.py @ 96:9746227239e0

client: fix import --no-commit flag (issue3206)
author Idan Kamara <idankk86@gmail.com>
date Mon, 16 Jan 2012 12:52:30 +0200
parents a0328b08e028
children e738d6fe5f3f
comparison
equal deleted inserted replaced
95:bd23bc72e662 96:9746227239e0
1 import common, cStringIO 1 import common, cStringIO, os
2 import hglib 2 import hglib
3 3
4 patch = """ 4 patch = """
5 # HG changeset patch 5 # HG changeset patch
6 # User test 6 # User test
21 self.client.import_(cStringIO.StringIO(patch)) 21 self.client.import_(cStringIO.StringIO(patch))
22 self.assertEquals(self.client.cat(['a']), '1\n') 22 self.assertEquals(self.client.cat(['a']), '1\n')
23 23
24 def test_basic_file(self): 24 def test_basic_file(self):
25 open('patch', 'wb').write(patch) 25 open('patch', 'wb').write(patch)
26
27 # --no-commit
28 self.client.import_(['patch'], nocommit=True)
29 self.assertEquals(open('a').read(), '1\n')
30
31 self.client.update(clean=True)
32 os.remove('a')
33
26 self.client.import_(['patch']) 34 self.client.import_(['patch'])
27 self.assertEquals(self.client.cat(['a']), '1\n') 35 self.assertEquals(self.client.cat(['a']), '1\n')