| OLD | NEW |
| 1 @echo off | 1 @echo off |
| 2 :: Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 :: Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 :: Use of this source code is governed by a BSD-style license that can be | 3 :: Use of this source code is governed by a BSD-style license that can be |
| 4 :: found in the LICENSE file. | 4 :: found in the LICENSE file. |
| 5 | 5 |
| 6 :: This batch file will try to sync the root directory. | 6 :: This batch file will try to sync the root directory. |
| 7 | 7 |
| 8 setlocal | 8 setlocal |
| 9 | 9 |
| 10 :: Will download svn and python. | 10 :: Will download svn and python. |
| 11 :: If you don't want to install the depot_tools version of these tools, remove | 11 :: If you don't want to install the depot_tools version of these tools, remove |
| 12 :: the 'force' option on the next command. The tools will be installed only if | 12 :: the 'force' option on the next command. The tools will be installed only if |
| 13 :: not already in the PATH environment variable. | 13 :: not already in the PATH environment variable. |
| 14 call "%~dp0bootstrap\win\win_tools.bat" force | 14 call "%~dp0bootstrap\win\win_tools.bat" force |
| 15 if errorlevel 1 goto :EOF | 15 if errorlevel 1 goto :EOF |
| 16 :: Now clear errorlevel so it can be set by other programs later. |
| 17 set errorlevel= |
| 16 | 18 |
| 17 :: Shall skip automatic update? | 19 :: Shall skip automatic update? |
| 18 IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF | 20 IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF |
| 19 | 21 |
| 20 :: We need either .\.svn\. or .\.git\. to be able to sync. | 22 :: We need either .\.svn\. or .\.git\. to be able to sync. |
| 21 IF EXIST "%~dp0.svn\." GOTO :SVN_UPDATE | 23 IF EXIST "%~dp0.svn\." GOTO :SVN_UPDATE |
| 22 IF EXIST "%~dp0.git\." GOTO :GIT_UPDATE | 24 IF EXIST "%~dp0.git\." GOTO :GIT_UPDATE |
| 23 echo Error updating depot_tools, no revision tool found. | 25 echo Error updating depot_tools, no revision tool found. |
| 24 goto :EOF | 26 goto :EOF |
| 25 | 27 |
| 26 | 28 |
| 27 :SVN_UPDATE | 29 :SVN_UPDATE |
| 28 call svn up -q "%~dp0." | 30 call svn up -q "%~dp0." |
| 29 goto :EOF | 31 goto :EOF |
| 30 | 32 |
| 31 | 33 |
| 32 :GIT_UPDATE | 34 :GIT_UPDATE |
| 33 cd /d "%~dp0." | 35 cd /d "%~dp0." |
| 36 call git config remote.origin.fetch > NUL |
| 37 if errorlevel 1 goto :GIT_SVN_UPDATE |
| 38 call git fetch -q origin > NUL |
| 39 call git rebase -q origin > NUL |
| 40 goto :EOF |
| 41 |
| 42 :GIT_SVN_UPDATE |
| 43 cd /d "%~dp0." |
| 34 call git svn rebase -q -q | 44 call git svn rebase -q -q |
| 35 goto :EOF | 45 goto :EOF |
| OLD | NEW |