在本地删除文件后跟svn update会恢复该文件的本地副本.但是,这似乎不适用于文件夹.有没有办法使它适用于文件夹?
编辑:这是控制台输出的样子:
C:\svn\Google Project Hosting\xulwin\xulrunnersamples>rmdir /S /Q treeview
C:\svn\Google Project Hosting\xulwin\xulrunnersamples>svn up
D treeview
Updated to revision 50.
Run Code Online (Sandbox Code Playgroud)
编辑2:我已经使用svn超过两年了,我之前从未遇到过这个错误.但我没有改变任何设置.我唯一能想到的是,我今天在外部硬盘驱动器上创建了一个带有Tortoise SVN的本地存储库来备份一些不相关的旧东西.但这不应该是问题的原因,因为行为发生在本地存储库的本地副本和Google Project Hosting的代码中.
EDIT3:WTF我突然无法重现这个bug.这一切都可以正常运作.但我没有改变任何事情.
EDIT4:在EDIT1中,文件似乎被标记为已删除,但它不是因为svn commit命令没有做任何事情.Tortoise检查修改是否也没有列出任何内容.
注意:当问题仍然存在时,完全递归更新确实还原了该文件夹.
Bry*_*ery 68
我今天用svn 1.5.6遇到了这个问题.
svn up --force the_dir_path为我修好了.
要重新创建:
$ svn up
Updated to revision X.
$ rm -rf the_dir_path
$ svn up
D the_dir_path
Updated to revision X.
$ svn up
Updated to revision X.
$ svn up --force the_dir_path
A ....
A ....
Updated to revision X.
Run Code Online (Sandbox Code Playgroud)
tsc*_*ble 13
您可能希望使用svn revert命令,而不是通过删除项目然后更新以还原它们的过程.使用-R开关递归还原文件/目录.
恢复的svn帮助信息如下
revert: Restore pristine working copy file (undo most local edits).
usage: revert PATH...
Note: this subcommand does not require network access, and resolves
any conflicted states. However, it does not restore removed directories.
Valid options:
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--changelist ARG : operate only on members of changelist ARG
[aliases: --cl]
Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG
--no-auth-cache : do not cache authentication tokens
--non-interactive : do no interactive prompting
--trust-server-cert : accept unknown SSL server certificates without
prompting (but only with '--non-interactive')
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf
Run Code Online (Sandbox Code Playgroud)