comparison tests/test_util.py @ 96:9b5e528f67f8

Add a test to check EOLs are correctly converted
author Patrick Mezard <pmezard@gmail.com>
date Thu, 20 Nov 2008 22:41:16 -0600
parents 7d10165cf3d9
children e58c2f1de059
comparison
equal deleted inserted replaced
95:10dd34deac3b 96:9b5e528f67f8
99 # define this as a property so that it reloads anytime we need it 99 # define this as a property so that it reloads anytime we need it
100 @property 100 @property
101 def repo(self): 101 def repo(self):
102 return hg.repository(ui.ui(), self.wc_path) 102 return hg.repository(ui.ui(), self.wc_path)
103 103
104 def pushrevisions(self): 104 def pushrevisions(self, stupid=False):
105 push_cmd.push_revisions_to_subversion( 105 push_cmd.push_revisions_to_subversion(
106 ui.ui(), repo=self.repo, hg_repo_path=self.wc_path, 106 ui.ui(), repo=self.repo, hg_repo_path=self.wc_path,
107 svn_url=fileurl(self.repo_path)) 107 svn_url=fileurl(self.repo_path), stupid=stupid)
108 108
109 def svnls(self, path, rev='HEAD'): 109 def svnls(self, path, rev='HEAD'):
110 path = self.repo_path + '/' + path 110 path = self.repo_path + '/' + path
111 path = fileurl(path) 111 path = fileurl(path)
112 args = ['svn', 'ls', '-r', rev, '-R', path] 112 args = ['svn', 'ls', '-r', rev, '-R', path]
167 '2008-10-07 20:59:48 -0500') 167 '2008-10-07 20:59:48 -0500')
168 nodeid = repo.commitctx(ctx) 168 nodeid = repo.commitctx(ctx)
169 repo = self.repo 169 repo = self.repo
170 hg.update(repo, nodeid) 170 hg.update(repo, nodeid)
171 return nodeid 171 return nodeid
172
173 def assertchanges(self, changes, ctx):
174 """Assert that all 'changes' (as in defined in commitchanged())
175 went into ctx.
176 """
177 for source, dest, data in changes:
178 if dest is None:
179 self.assertTrue(source not in ctx)
180 continue
181 self.assertTrue(dest in ctx)
182 if data is None:
183 data = ctx.parents()[0][source].data()
184 self.assertEqual(ctx[dest].data(), data)
185 if dest != source:
186 copy = ctx[dest].renamed()
187 self.assertEqual(copy[0], source)