Mercurial > hg
view tests/test-hgwebdir-paths.py @ 39224:5e52b6da9c0c
tests: demonstrate a problem with renames on the p2 side of a conversion
I think this is related to the octopus merge being sloppy, and that's having a
cascading affect on the fixup merge. If this change is made on p1 (specifically
with the 'Added parent file' commit), the failure doesn't occur.
The file modification with the rename doesn't seem to be necessary, but it's
what's happening in a production repo where I first noticed, so I left it. This
is an example of the manifest divergence I'd been seeing, which wasn't fixed by
Yuya's recent changes. This is separate from the changelog divergence I was
also seeing[1]. Probably nobody cares about bzr anymore, but this will also
affect git, since the octopus fixup code is in the hg sink.
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-August/120473.html
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 20 Aug 2018 16:19:36 -0400 |
parents | 81455f482478 |
children | 2372284d9457 |
line wrap: on
line source
from __future__ import absolute_import import os from mercurial import ( hg, ui as uimod, ) from mercurial.hgweb import ( hgwebdir_mod, ) hgwebdir = hgwebdir_mod.hgwebdir os.mkdir(b'webdir') os.chdir(b'webdir') webdir = os.path.realpath(b'.') u = uimod.ui.load() hg.repository(u, b'a', create=1) hg.repository(u, b'b', create=1) os.chdir(b'b') hg.repository(u, b'd', create=1) os.chdir(b'..') hg.repository(u, b'c', create=1) os.chdir(b'..') paths = {b't/a/': b'%s/a' % webdir, b'b': b'%s/b' % webdir, b'coll': b'%s/*' % webdir, b'rcoll': b'%s/**' % webdir} config = os.path.join(webdir, b'hgwebdir.conf') configfile = open(config, 'wb') configfile.write(b'[paths]\n') for k, v in paths.items(): configfile.write(b'%s = %s\n' % (k, v)) configfile.close() confwd = hgwebdir(config) dictwd = hgwebdir(paths) assert len(confwd.repos) == len(dictwd.repos), 'different numbers' assert len(confwd.repos) == 9, 'expected 9 repos, found %d' % len(confwd.repos) found = dict(confwd.repos) for key, path in dictwd.repos: assert key in found, 'repository %s was not found' % key assert found[key] == path, 'different paths for repo %s' % key