cmdutil: make walkchangerevs() gracefully handle wdir parents
This code will be completely rewritten, but test-grep.t would fail without
fixing it.
{
"conduit_uri": "https://phab.mercurial-scm.org/api",
"phabricator.uri": "https://phab.mercurial-scm.org/",
"repository.callsign": "HG",
"arc.land.onto.default": "@",
"base": "hg:.^"
}