windows: use normalized path as path to subrepo
path to subrepo is used to identify or check location of subrepo.
it should be normalized (in "/" delimiter form), because it is also
used with narrowmatcher which uses only normalized path even on
Windows environment.
this patch applies "util.pconvert()" on path to subrepo (called
"subpath") to normalize it.
for this patch, referers of below were checked.
- subrepo.state()
- subrepo.itersubrepos()
- subrepo.subrepo()
- context.sub()
- context.substate()
typical usecase is:
for subpath in ctx.substate:
sub = ctx.sub(subpath)
... ctx.substate[subpath] ....
in this case, normalization has no side effect, because keys given
from substate are used as key itself.
other cases shown below also seem to require subpath to be normalized.
- path components are joined by "/", in "commands.forget()":
for subpath in ctx.substate:
subforget[subpath + '/' + fsub] = (fsub, sub)
- normalized "file" is used to check below condition, in
"commands.revert()", "localrepository.commit()", and
"localrepository._checknested()"
file in ctx.substate
- substate.keys() is passed to dirstate.walk()/status() which use
only normalized pathes
$ "$TESTDIR/hghave" svn svn-bindings || exit 80
$ cat >> $HGRCPATH <<EOF
> [extensions]
> convert =
> graphlog =
> EOF
$ convert()
> {
> startrev=$1
> repopath=A-r$startrev-hg
> hg convert --config convert.svn.startrev=$startrev \
> --config convert.svn.trunk=branches/branch1 \
> --config convert.svn.branches=" " \
> --config convert.svn.tags= \
> --datesort svn-repo $repopath
> hg -R $repopath glog \
> --template '{rev} {desc|firstline} files: {files}\n'
> echo
> }
$ svnadmin create svn-repo
$ svnadmin load -q svn-repo < "$TESTDIR/svn/startrev.svndump"
Convert before branching point
$ convert 3
initializing destination A-r3-hg repository
scanning source...
sorting...
converting...
3 removeb
2 changeaa
1 branch, changeaaa
0 addc,changeaaaa
o 3 addc,changeaaaa files: a c
|
o 2 branch, changeaaa files: a
|
o 1 changeaa files: a
|
o 0 removeb files: a
Convert before branching point
$ convert 4
initializing destination A-r4-hg repository
scanning source...
sorting...
converting...
2 changeaa
1 branch, changeaaa
0 addc,changeaaaa
o 2 addc,changeaaaa files: a c
|
o 1 branch, changeaaa files: a
|
o 0 changeaa files: a
Convert at branching point
$ convert 5
initializing destination A-r5-hg repository
scanning source...
sorting...
converting...
1 branch, changeaaa
0 addc,changeaaaa
o 1 addc,changeaaaa files: a c
|
o 0 branch, changeaaa files: a
Convert last revision only
$ convert 6
initializing destination A-r6-hg repository
scanning source...
sorting...
converting...
0 addc,changeaaaa
o 0 addc,changeaaaa files: a c