subrepo: calculate _relpath for hgsubrepo based on self instead of parent
Prior to
105758d1b37b, the subrelpath() (now _relpath) for hgsubrepo was
calculated by removing the root path of the outermost repo from the root path of
the subrepo. Since the root paths use platform specific separators, and the
relative path is printed by various commands, the output of these commands
require a glob (and check-code.py enforces this).
In an effort to be generic to all subrepos,
105758d1b37b started calculating
this path based on the parent repo, and then joining the subrepo path in .hgsub.
One of the tests in test-subrepo.t creates a subrepo inside a directory, so the
path being joined contained '/' instead of '\'. This made the test fail with a
'~' status, because the glob is unnecessary[1]. Removing them made the test
work, but then check-code complains. We can't just drop the check-code rule,
because sub-subrepos are still joined with '\'. Presumably the other subrepo
types have this issue as well, but there likely isn't a test with git or svn
repos inside a subdirectory.
This simply restores the exact _relpath value (and output) for hgsubrepos prior
to
105758d1b37b.
[1] http://www.selenic.com/pipermail/mercurial-devel/2015-April/068720.html
Issue351: mq: qrefresh can create extra revlog entry
$ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ hg init
$ hg qinit
$ echo b > b
$ hg ci -A -m foo
adding b
$ echo cc > b
$ hg qnew -f foo.diff
$ echo b > b
$ hg qrefresh
$ hg debugindex b
rev offset length ..... linkrev nodeid p1 p2 (re)
0 0 3 ..... 0 1e88685f5dde 000000000000 000000000000 (re)