SVN - 特定类型的稀疏检出文件 - 或 - 匹配特定模式

SVN - Sparse Checkout Files of Certain Type -or- Matching Certain Pattern

我正在使用一个庞大的 SVN 存储库 -- 它由数百个目录(所有目录都在不同的深度)和数千个文件(所有不同类型)组成。我需要对该存储库中包含的数百个 JavaScript 文件进行批量更新。我没有下载整个 repo,而是希望有选择地只签出 .js 文件。我一直在尝试各种不同的方法,但一直无法破解它。这是我能够想出的...

# CHECKOUT INITIAL WORKING COPY
svn co https://myrepo.com/site-content --depth empty

# NAVIGATE TO WORKING COPY
cd site-content

# CHECKOUT FULL DIRECTORY TREE
env REPO=https://myrepo.com/site-content sh -c 'svn ls -R $REPO | grep "/$" | xargs -n 1 svn co --depth empty $REPO'

# UPDATE WORKING COPY WITH .JS FILES
svn up `svn ls -R https://myrepo.com/site-content | grep .js$`

我在终端中得到的回复似乎表明一切正常,然而,事实显然并非如此。我留下了完整的目录树,但绝对没有 .js 文件。这是我的终端输出示例:

jakes-mac:working-copy jake$ svn co https://myrepo.com/site-content --depth empty

    Checked out revision 21097.

jakes-mac:working-copy jake$ cd site-content

jakes-mac:site-content jake$ env REPO=https://myrepo.com/site-content sh -c 'svn ls -R $REPO | grep "/$" | xargs -n 1 svn co --depth empty $REPO'

    Checked out revision 21098.
    Checked out revision 21098.
    Checked out revision 21098.
    Checked out revision 21098.
    Checked out revision 21098.
    ...
    Checked out revision 21099.
    Checked out revision 21099.
    Checked out revision 21099.
    Checked out revision 21099.
    Checked out revision 21099.

jakes-mac:site-content jake$ svn up `svn ls -R https://myrepo.com/site-content | grep .js$`

    Updating '2013/js/_old/script.trees.bak.rev-a.js':
    At revision 21100.
    Updating '2013/js/_old/script.video.bak.rev-a.js':
    At revision 21100.
    Updating '2013/js/script.category.js':
    At revision 21100.
    Updating '2013/js/script.trees.js':
    At revision 21100.
    Updating '2013/js/script.video-v2.js':
    At revision 21100.
    Updating '2013/js/script.video.js':
    At revision 21100.
    Updating '2014/TreeGiveaway/js/script.sweeps.js':
    At revision 21100.
    Updating '2014/TreeGiveaway/js/validate-voting.js':
    At revision 21100.
    Updating '2014/js/collectionslider.js':
    At revision 21100.
    Updating '2014/js/difference.js':
    At revision 21100.
    Updating '2014/js/mobile.js':
    At revision 21100.
    Updating '2014/js/script.category.js':
    At revision 21100.
    Updating '2014/js/script.quicklight_inset.js':
    At revision 21100.
    Updating '2014/js/script.trees.js':
    At revision 21100.
    Updating '2014/js/script.trees.v3.js':
    At revision 21100.
    Updating '2014/js/script.trees_inset.js':
    At revision 21100.
    Updating '2014/js/script.trees_inset.new.js':
    At revision 21100.
    Updating '2014/slideshow/js/jquery.easing.min.js':
    At revision 21100.
    Updating '2014/slideshow/js/script.js':
    At revision 21100.
    Updating '2014/slideshow/js/supersized.3.2.7.js':
    At revision 21100.
    Updating '2014/slideshow/js/supersized.shutter.js':
    At revision 21100.
    Updating '2015/js/framework.fetchFeed.js':
    At revision 21100.
    Updating '2015/js/framework.goModal.js':
    At revision 21100.
    Updating '2015/js/frameworkForMobile.js':
    At revision 21100.
    Updating '2015/js/script.category.js':
    At revision 21100.
    Updating '2015/js/script.hs.js':
    At revision 21100.
    Updating '2015/js/script.shop-the-scene.js':
    At revision 21100.
    Updating '2015/js/script.trees.js':
    At revision 21100.
    Updating '2015/tree-finder/results.script-v2.js':
    At revision 21100.
    Updating '2015/tree-finder/results.script.js':
    At revision 21100.
    Updating '2015/tree-finder/wizard.script.js':
    At revision 21100.
    Updating 'current/js/holiday-decor.js':
    At revision 21100.
    Updating 'current/js/how-to.js':
    At revision 21100.
    Updating 'current/js/shop-the-style.js':
    At revision 21100.

编辑:

一切正常!最终命令列表:

# CHECKOUT INITIAL WORKING COPY
svn co https://myrepo.com/site-content --depth empty

# NAVIGATE TO WORKING COPY
cd site-content

# CHECKOUT FULL DIRECTORY TREE
env REPO=https://myrepo.com/site-content sh -c 'svn ls -R $REPO | grep "/$" | while read dir; do svn co --depth=empty $REPO/$dir $dir; done'

# UPDATE WORKING COPY WITH .JS FILES
svn up `svn ls -R https://myrepo.com/site-content | grep .js$`

# COMMIT ALL CHANGES TO REPO
svn commit `svn ls -R | grep .js$` -m "Bulk Updating Content"

使用 "CHECKOUT FULL DIRECTORY TREE" 命令,您在所有目录中重新检查了存储库根目录。

env REPO=https://myrepo.com/site-content sh -c 'svn ls -R $REPO | \
grep "/$" | xargs -n 1 svn co --depth empty $REPO'
                                             ^^^^^

查看例如的输出svn info 2014/js/

“...似乎表明一切正常,”- 这不是真的,因为人们看不到
这样的行 A <filename> 例如

Updating '2014/js/script.trees.v3.js':
A    2014/js/script.trees.v3.js

尝试这样的事情:

env REPO=https://myrepo.com/site-content sh -c 'svn ls -R $REPO | \
    grep "/$" | while read dir; do svn co --depth=empty $REPO/$dir $dir; done'