comparison tests/test_unaffected_core.py @ 1346:538bbb927609

Merge with stable.
author Augie Fackler <raf@durin42.com>
date Tue, 11 Aug 2015 17:07:59 -0400
parents 38be7a6b6def
children 306187268f59
comparison
equal deleted inserted replaced
1341:7e10891666fe 1346:538bbb927609
9 from mercurial import hg 9 from mercurial import hg
10 from mercurial import node 10 from mercurial import node
11 from mercurial import ui 11 from mercurial import ui
12 12
13 def _dispatch(ui, cmd): 13 def _dispatch(ui, cmd):
14 assert '--quiet' in cmd
14 try: 15 try:
15 req = dispatch.request(cmd, ui=ui) 16 req = dispatch.request(cmd, ui=ui)
16 dispatch._dispatch(req) 17 dispatch._dispatch(req)
17 except AttributeError: 18 except AttributeError:
18 dispatch._dispatch(ui, cmd) 19 dispatch._dispatch(ui, cmd)
24 25
25 @test_util.requiresoption('updaterev') 26 @test_util.requiresoption('updaterev')
26 def test_update(self): 27 def test_update(self):
27 ''' Test 'clone --updaterev' ''' 28 ''' Test 'clone --updaterev' '''
28 ui = self.ui() 29 ui = self.ui()
29 _dispatch(ui, ['init', self.wc_path]) 30 _dispatch(ui, ['init', '--quiet', self.wc_path])
30 repo = self.repo 31 repo = self.repo
31 repo.ui.setconfig('ui', 'username', 'anonymous') 32 repo.ui.setconfig('ui', 'username', 'anonymous')
32 33
33 fpath = os.path.join(self.wc_path, 'it') 34 fpath = os.path.join(self.wc_path, 'it')
34 f = file(fpath, 'w') 35 f = file(fpath, 'w')
44 commands.commit(ui, repo, message="C3") 45 commands.commit(ui, repo, message="C3")
45 46
46 self.assertEqual(test_util.repolen(repo), 3) 47 self.assertEqual(test_util.repolen(repo), 3)
47 48
48 updaterev = 1 49 updaterev = 1
49 _dispatch(ui, ['clone', self.wc_path, self.wc_path + '2', 50 _dispatch(ui, ['clone', '--quiet',
50 '--updaterev=%s' % updaterev]) 51 self.wc_path, self.wc_path + '2',
52 '--updaterev=%s' % updaterev])
51 53
52 repo2 = hg.repository(ui, self.wc_path + '2') 54 repo2 = hg.repository(ui, self.wc_path + '2')
53 55
54 self.assertEqual(str(repo[updaterev]), str(repo2['.'])) 56 self.assertEqual(str(repo[updaterev]), str(repo2['.']))
55 57
56 @test_util.requiresoption('branch') 58 @test_util.requiresoption('branch')
57 def test_branch(self): 59 def test_branch(self):
58 ''' Test 'clone --branch' ''' 60 ''' Test 'clone --branch' '''
59 ui = self.ui() 61 ui = self.ui()
60 _dispatch(ui, ['init', self.wc_path]) 62 _dispatch(ui, ['init', '--quiet', self.wc_path])
61 repo = self.repo 63 repo = self.repo
62 repo.ui.setconfig('ui', 'username', 'anonymous') 64 repo.ui.setconfig('ui', 'username', 'anonymous')
63 65
64 fpath = os.path.join(self.wc_path, 'it') 66 fpath = os.path.join(self.wc_path, 'it')
65 f = file(fpath, 'w') 67 f = file(fpath, 'w')
78 commands.commit(ui, repo, message="C3") 80 commands.commit(ui, repo, message="C3")
79 81
80 self.assertEqual(test_util.repolen(repo), 3) 82 self.assertEqual(test_util.repolen(repo), 3)
81 83
82 branch = 'B1' 84 branch = 'B1'
83 _dispatch(ui, ['clone', self.wc_path, self.wc_path + '2', 85 _dispatch(ui, [
84 '--branch', branch]) 86 'clone', '--quiet',
87 self.wc_path, self.wc_path + '2',
88 '--branch', branch])
85 89
86 repo2 = hg.repository(ui, self.wc_path + '2') 90 repo2 = hg.repository(ui, self.wc_path + '2')
87 91
88 self.assertEqual(repo[branch].hex(), repo2['.'].hex()) 92 self.assertEqual(repo[branch].hex(), repo2['.'].hex())