The old logic was broken -- it didn't work at the boundary between hg and git
commits. The logic in overlayrevlog.parents handles that correctly.
This is the last fix required for Mercurial 3.4.
In Mercurial, every commit has at least one parent -- root commits have the
null revision as their parent. In Git, root commits don't have any parents.
This difference needs to be papered over in hg-git for 'hg incoming' to work in
Mercurial 3.4+.
Note that this doesn't fix all the broken tests in default -- I haven't had
time to investigate the others.
fd926a0f2592 in upstream Mercurial added a matches function to the manifest.
This broke 'hg incoming -p' with hg-git. This patch adds a simple implementation
that fixes the problem.
This was caught by the tests, and now the tests pass.
Previously, we'd try to access commit.parents[0] and fail. Now, check for
commit.parents being empty and return what Mercurial thinks is a repository
root in that case.
Previously we'd just test if gitrev was falsy, which it is if the rev returned
is 0, even though it shouldn't be. With this patch, test against None
explicitly.
This unmasks another bug: see next patch for a fix and a test.
This was crafted mostly via a bunch of aimless flailing in the
code. I'm pretty well convinced at this point that the incoming
support needs to be rewritten slightly to behave properly in the new
world order (specifically, the overlayrepo class probably should be
subclassing localrepo, or else more directly reimplementing things
instead of trying to forward methods.)
This isn't a real implementation of phases support. Rather, it's just enough
to avoid the traceback.
Traceback (most recent call last):
File "/usr/local/share/python/hg", line 38, in <module>
mercurial.dispatch.run()
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 65, in dispatch
return _runcatch(req)
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 88, in _runcatch
return _dispatch(req)
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 741, in _dispatch
cmdpats, cmdoptions)
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 514, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 831, in _runcommand
return checkargs()
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 802, in checkargs
return cmdfunc()
File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 738, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 472, in check
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/mercurial/commands.py", line 3942, in incoming
return hg.incoming(ui, repo, source, opts)
File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 525, in incoming
return _incoming(display, subreporecurse, ui, repo, source, opts)
File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 494, in _incoming
displaychlist(other, chlist, displayer)
File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 524, in display
displayer.show(other[n])
File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 670, in show
self._show(ctx, copies, matchfn, props)
File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 691, in _show
label='log.changeset changeset.%s' % ctx.phasestr())
File "/usr/local/lib/python2.7/site-packages/mercurial/context.py", line 203, in phasestr
return phases.phasenames[self.phase()]
File "/usr/local/lib/python2.7/site-packages/mercurial/context.py", line 201, in phase
return self._repo._phasecache.phase(self._repo, self._rev)
AttributeError: 'overlaychangectx' object has no attribute '_repo'
This changeset adds test coverage for comparing "hg outgoing -B" in normal
Mercurial usage with Hg-Git usage. This didn't match, since previously, gitrepo
didn't provide a meaningful listkeys implementation. Now, it does.
gitrepo now has access to a GitHandler when a localrepo is available. This
handler is used to access the information needed to implement listkeys for
namespaces (currently, only bookmarks) and bookmarks.
A couple of other tests were testing "divergent bookmark" scenarios. These
tests have been updated to filter out the divergent bookmark output, as it isn't
consistent across the supported Mercurial versions.