用于更新SVN文件夹的命令行 [英] Command line to update SVN folders

查看:862
本文介绍了用于更新SVN文件夹的命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我已经尝试了几件事,但我还没有运气。我试图有一个命令行或PowerShell脚本,我可以运行一天,以确保我的众多签出项目是最新的。

I have tried several things so far, but I haven't had much luck yet. I'm attempting to have a command line or PowerShell script that I can run once a day to make sure my numerous checked-out projects are up to date.

我知道我会循环通过我的工作区内的目录文件夹,但是当我设置的变量,我没有任何运气,因为它会错误。我使用 TortoiseSVN Windows Vista。

I know I would be looping through the directory folders inside my workspace, but when setting the variables I haven't had any luck as it will error out. I am using TortoiseSVN, and Windows Vista.

这里是我到目前为止:

echo == Initiating system instance variables...
echo. -- Setting the variables...

:: Here you need to make some changes to suit your system.
set SOURCE=C:\workspace\Project
set SVN=C:\Program Files\TortoiseSVN\bin
:: Unless you want to modify the script, this is enough.

echo. %SOURCE%
echo. %SVN%
echo. ++ Done setting variables.
echo.
echo == Updating source from SVN
echo. -- Running update...
"%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%" /closeonend:2
echo. ++ Done.

echo. -- Cleaning up...
set SOURCE=
set SVN=
echo. ++ Done.

@echo off


推荐答案

在PowerShell中可能更容易:

It might be easier in PowerShell:

Set-Alias tsvn 'C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe'
dir C:\workspace | %{ tsvn /command:update /path:"$($_.FullName)" /closeonend:2 }

或者如果您要指定某些项目目录:

Or if you want to specify certain project directories:

cd C:\workspace
$projects = 'Proj 1','Proj 2','Proj 3'
$projects | %{ tsvn /command:update /path:"$_" /closeonend:2 }



有一个ps1扩展名。您可能还必须更新执行策略以允许脚本运行:

PowerShell scripts have a ps1 extension. You might also have to update the execution policy to allow scripts to run:

Set-ExecutionPolicy RemoteSigned

这篇关于用于更新SVN文件夹的命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆