Automatically update SVN during batch processing

Source: Internet
Author: User
Tags schtasks

During this development project, some people in the team always forget to updateCode, Leading to issues such as code non-synchronization. It is easy for us to manually repeat each piece of work. If we make repetitive work into a template, is it much better.

Then we will give this job to our computer, "automatically update code before going to work every day" is divided into two parts. The first step is "Update SVN", which can be completed using tortoiseproc.exe, and the second step is to use scheduled system tasks for regular execution.

Step 1: autosvn. bat

 

@ Echo off

@ Echo ===================================

@ Echo author Luo mingui

@ Echo blog: http://luomingui.cnblogs.com

@ Echo Email: luomingui@hailin.com

@ Echo update: 2012-08-27

@ Echo ===================================

Rem SVN installation directory

Set svn_home = D: \ Program Files \ tortoisesvn \ bin

Rem SVN working directory

Set svn_work = F: \ Hailin \ project \ Oha \ heatingmanager \ source \ trunk

Rem SVN log directory

Set setup_path = D :\

@ Echo updating directory % svn_work %

If exist % svn_work % Goto: gengxin else Goto: mk

: Mk

@ Echo check whether your working directory is correct

Echo & pause Goto: End

@ ECHO: update complete and exit

Goto: End

: End

Exit

: Gengxin

If exist "% setup_path %" \ AutoUpdate. log (echo update: % date % time %> "% setup_path %" \ AutoUpdate. log) else echo create: % date % time %> "% setup_path %" \ AutoUpdate. log

"% Svn_home %" \ tortoiseproc.exe/command: update/path: "% svn_work %"/notempfile/closeonend: 1

Exit

Step 2: schedule task setup. bat

 

@ Echo off

@ Echo ===================================

@ Echo author Luo mingui

@ Echo blog: http://luomingui.cnblogs.com

@ Echo Email: luomingui@hailin.com

@ Echo update: 2012-08-27

@ Echo ===================================

@ ECHO: Add a task

Schtasks/create/SC daily/ST 08:30:00/TN "auto update SVN"/TR "% ~ Sdp0autosvn. Bat "/F

Step 3: Use

 

1: Save the content of step 1 and Step 2 to the BAT file.

2: Modify the svn installation directory, SVN working directory, and SVN log directory attributes in step 1 as needed.

3: Execute the setup. BAT file installation task.

MATERIALS:

 

Schtasks: http://hi.baidu.com/feavar/blog/item/fadac21ba8cc07fbae513375.html

Online example: http://www.cnblogs.com/doupip/archive/2012/02/10/2345708.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.