SVN auto commit

Source: Internet
Author: User
Tags svn update
SVN can use svn update path to synchronize the latest version on the server to the local device,
You can also use svn commit path to synchronize local versions to the server. However, commit only supports files that have been version controlled,
The newly added directory or file is not supported, so in order to implement this function, it took me half a day to write a bat for processing,
The implementation principle is to first find the newly added file, then add it to the version library using svn add path, and then svn commit.
Post for your reference:
Svn_commit.bat
------------------------------------------------------
@ Echo off
REM sets SVN directory
Set SVN_DB = "D: \ SHARE \ DOCUMENT \ SVN"

REM Synchronization
Svn update % SVN_DB %

REM displays the status of the files in the directory that are not commit to the temporary file, and each status row
Svn status % SVN_DB %> c: \ svn.txt

REM parses temporary files, parses various statuses, and adds newly created directories.
For/f "delims =" % I in (c: \ svn.txt) do (
Call svn_commit_one.bat "% I"
)

REM unified submission
Svn commit % SVN_DB %-m "automatic server processing"

Svn_commit_one.bat
---------------------------------------------------
REM read Parameters
SET SVN_PARA = % 1

REM read first state
SET SVN_TYPE = % SVN_PARA ~ 1, 1%

Names of Files Read by REM in subsequent states
SET SVN_FILE = "% SVN_PARA ~ 9%

REM if the status is ?, The directory is not bound. Add
IF "% SVN_TYPE %" = "? "(Svn add % SVN_FILE %)

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.