本文本尚未完善,内容可能随时变更,可能无法准确描述任何已发布的 Apache™ Subversion® 软件版本。将此页面添加书签或推荐给他人可能不是明智之举。请访问 http://svnbooks.subversion.org.cn/ 以获取本书的稳定版本。
svndumpfilter include — 从转储流中过滤掉没有指定前缀的节点。
svndumpfilter include PATH_PREFIX...
如果我们从一个包含许多不同野餐相关目录的存储库中获取转储文件,但只想保留存储库的 sandwiches
部分,我们将只包含该路径
$ svndumpfilter include sandwiches < dumpfile > filtered-dumpfile Including prefixes: '/sandwiches' Revision 0 committed as 0. Revision 1 committed as 1. Revision 2 committed as 2. Revision 3 committed as 3. Revision 4 committed as 4. Dropped 12 node(s): '/condiments' '/condiments/pepper' '/condiments/pepper.OLD' '/condiments/salt' '/condiments/salt.OLD' '/drinks' '/snacks' '/supplies' '/toppings' '/toppings/cheese' '/toppings/cheese.OLD' '/toppings/lettuce' $
从 Subversion 1.7 开始,svndumpfilter 可以选择性地将 PATH_PREFIX
不仅仅视为显式子字符串,而是视为文件模式。例如,如果只想包含以 ks
结尾的路径,则可以执行以下操作
$ svndumpfilter include --pattern "*ks" < dumpfile > filtered-dumpfile Including prefix patterns: '/*ks' Revision 0 committed as 0. Revision 1 committed as 1. Revision 2 committed as 2. Revision 3 committed as 3. Revision 4 committed as 4. Dropped 11 node(s): '/condiments' '/condiments/pepper' '/condiments/pepper.OLD' '/condiments/salt' '/condiments/salt.OLD' '/sandwiches' '/supplies' '/toppings' '/toppings/cheese' '/toppings/cheese.OLD' '/toppings/lettuce' $