开发者

SharpSVN: Recursivly delete "missing" files?

开发者 https://www.devze.com 2023-03-13 02:12 出处:网络
Is there a way to recursively svn delete files in a working copy that ha开发者_如何学运维ve been moved/deleted outside of SVN with SharpSVN?

Is there a way to recursively svn delete files in a working copy that ha开发者_如何学运维ve been moved/deleted outside of SVN with SharpSVN?

I have a task that runs periodically to commit a directory exactly as it is, but I need files that have been removed to be marked as deleted instead of missing.


You can probably handle this scenario like:

using (SvnClient c1 = new SvnClient())
using (SvnClient c2 = new SvnClient())
{
    c1.Status(@"F:\working-copy",
        delegate(object sender, SvnStatusEventArgs e)
        {
           if (e.Status == SvnStatus.Missing)
              c2.Delete(e.FullPath);
        });
}

(Untested code. Feel free to fix typos)

0

精彩评论

暂无评论...
验证码 换一张
取 消