comparison mercurial/localrepo.py @ 12174:7bccd04292a2

localrepo: check nested repos against working directory This checks against what is really in the filesystem, including subrepositories that have been added to .hgsub but not yet committed.
author Martin Geisler <mg@lazybytes.net>
date Tue, 07 Sep 2010 15:31:56 +0200
parents 441a74b8def1
children c0a8f9dea0f6
comparison
equal deleted inserted replaced
12173:5b849148b620 12174:7bccd04292a2
130 # been rejected before, such as the above cat command if sub/ 130 # been rejected before, such as the above cat command if sub/
131 # is a subrepository now, but was a normal directory before. 131 # is a subrepository now, but was a normal directory before.
132 # The old path auditor would have rejected by mistake since it 132 # The old path auditor would have rejected by mistake since it
133 # panics when it sees sub/.hg/. 133 # panics when it sees sub/.hg/.
134 # 134 #
135 # All in all, checking against the working copy parent 135 # All in all, checking against the working copy seems sensible
136 # revision seems sensible since we want to prevent access to 136 # since we want to prevent access to nested repositories on
137 # nested repositories on the filesystem *now*. 137 # the filesystem *now*.
138 ctx = self['.'] 138 ctx = self[None]
139 parts = util.splitpath(subpath) 139 parts = util.splitpath(subpath)
140 while parts: 140 while parts:
141 prefix = os.sep.join(parts) 141 prefix = os.sep.join(parts)
142 if prefix in ctx.substate: 142 if prefix in ctx.substate:
143 if prefix == subpath: 143 if prefix == subpath: