OSDN Git Service

git-llvm: Fix incremental population of svn tree.
authorJames Y Knight <jyknight@google.com>
Thu, 29 Nov 2018 16:46:34 +0000 (16:46 +0000)
committerJames Y Knight <jyknight@google.com>
Thu, 29 Nov 2018 16:46:34 +0000 (16:46 +0000)
commit97ddb1aa3fa348ec61494b14a20d67aebf4bb832
tree545c36ae531a9aa3d2996161b94f949d1e887195
parent95d853d6f33b9a698f52228b8f342b65024936c5
git-llvm: Fix incremental population of svn tree.

"svn update --depth=..." is, annoyingly, not a specification of the
desired depth, but rather a _limit_ added on top of the "sticky" depth
in the working-directory. However, if the directory doesn't exist yet,
then it sets the sticky depth of the new directory entries.

Unfortunately, the svn command-line has no way of expanding the depth
of a directory from "empty" to "files", without also removing any
already-expanded subdirectories. The way you're supposed to increase
the depth of an existing directory is via --set-depth, but
--set-depth=files will also remove any subdirs which were already
requested.

This change avoids getting into the state of ever needing to increase
the depth of an existing directory from "empty" to "files" in the
first place, by:

1. Use svn update --depth=files, not --depth=immediates.

The latter has the effect of checking out the subdirectories and
marking them as depth=empty. The former excludes sub-directories from
the list of entries, which avoids the problem.

2. Explicitly populate missing parent directories.

Using --parents seemed nice and easy, but it marks the parent dirs as
depth=empty. Instead, check out parents explicitly if they're missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347883 91177308-0d34-0410-b5e6-96231b3b80d8
utils/git-svn/git-llvm