Mercurial > hgsubversion
comparison tests/test_single_dir_push.py @ 1539:0ebcc5bbf692
tests: when making a `memctx`, make sure to use a single repo instance
The way self.repo is dynamic produces bad lock behavior because the
`context.memctx` ends up with a different instance than self in
`localrepo.commitctx`, which means the callbacks in the `memctx` get
an unlocked repo instance. This causes lock warning failures. When
it's not a code freeze for core, we should probably:
* Make lock failures hard, not just warnings
* Stop holding a repo reference in memctx, or otherwise check it's the same
instance as `self` during `localrepo.commitctx`
That's my best guess based on the (very hard to debug) test failures here.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sat, 28 Oct 2017 21:34:52 -0400 |
parents | e597714cb420 |
children | 8410a978c650 |
comparison
equal
deleted
inserted
replaced
1538:b0eca4d96a53 | 1539:0ebcc5bbf692 |
---|---|
184 data='foo', | 184 data='foo', |
185 islink=False, | 185 islink=False, |
186 isexec=False, | 186 isexec=False, |
187 copied=False) | 187 copied=False) |
188 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) | 188 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
189 ctx = context.memctx(self.repo, | 189 lr = self.repo |
190 (self.repo['tip'].node(), node.nullid), | 190 ctx = context.memctx(lr, |
191 (lr['tip'].node(), node.nullid), | |
191 'automated test', | 192 'automated test', |
192 ['adding_file'], | 193 ['adding_file'], |
193 file_callback, | 194 file_callback, |
194 'an_author', | 195 'an_author', |
195 '2009-10-19 18:49:30 -0500', | 196 '2009-10-19 18:49:30 -0500', |
196 {'branch': 'default', }) | 197 {'branch': 'default', }) |
197 self.repo.commitctx(ctx) | 198 lr.commitctx(ctx) |
198 hg.update(self.repo, self.repo['tip'].node()) | 199 hg.update(self.repo, self.repo['tip'].node()) |
199 self.pushrevisions() | 200 self.pushrevisions() |
200 self.assertTrue('adding_file' in test_util.svnls(repo_path, '')) | 201 self.assertTrue('adding_file' in test_util.svnls(repo_path, '')) |
201 | 202 |
202 self.assertEquals(set(['flaf']), | 203 self.assertEquals(set(['flaf']), |