>> The problem may be levered by recursively comparing the repository UID
>and
>> the relative path in the uri when the external is resolved. Proofing that
>> this check would be enough is left to the reader. :-)
>
>This will catch the "simple" case when an external includes its own parent
>directory.
>
>But it will not catch mutually recursive externals (svn://path/to/a/
>includes svn://path/to/b/ and vice-versa), there might even exist cycles
>over 3 or more repositories...
That's what I ment with recursive. Since externals resolve from the parent
repository down to the child repository, before checking out the child
repository all parent repositories would have to be checked if it could be a
recursive checkout, i.e. in a python-like pseudocode:
Def Checkout(repoUri, []parents={}):
Foreach childRepoUri in repoUri:
If(IsPossiblyRecursive(childRepoUri, parents)):
Warn()
If(ConfirmByUser())
Checkout(childRepoUri, parents.Append(childRepoUri))
Else
Checkout(childRepoUri, parents.Append(childRepoUri))
Def IsPossiblyRecursive (repoUri, []parents={}):
If(parents.Count > 0)
Foreach parent in parents:
If(IsPossiblyRecursive (repoUri, parent))
True
Else
False
Def IsPossiblyRecursive (repoUri, parent):
If(UID(repoUri) == UID(parent))
# this might be a recursive checkout
# other checks like comparing the relative path could be put here
True
False
Cheers,
Dominik
Received on 2012-03-26 14:43:48 CEST