Last active
May 9, 2017 11:56
-
-
Save jeromechan/ae79300f1aadcdbf8747c492c1715bc6 to your computer and use it in GitHub Desktop.
Phabricator arc wrapper script that integrate with Subversion, and it is used for Windows platform. (中文:集成了FB的Phabricator arc命令和SVN命令的windows bat脚手架命令集.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem echo path | |
rem path | |
rem echo HELLO | |
rem pause | |
rem @pause | |
rem call php -v | |
rem CHOICE /? | |
rem CHOICE /C YNC /M continue? | |
rem type test.php | |
rem if exist a.bat echo 90 | |
rem if not exist a1.bat goto _done | |
rem echo 1 | |
rem :_done | |
rem for %%D in (*.bat) do type %%c rem not-include-hidden-files | |
rem ping -n 3 127.0.0.1>nul | |
cls | |
:_BEGIN | |
title Phabricator Assistant-Tool | |
rem chose the project dir | |
rem echo "Please chd to your project" | |
rem cd | |
rem set /p proj-dir= | |
rem call cd proj-dir | |
rem cd | |
rem goto _EOF | |
rem initial diff files | |
set affected-files = t.php xml/test.html | |
set cmt-revision = D53 | |
rem starting tips | |
echo Start sending reviewing request ... | |
rem noted current dir | |
echo ---CUR-DIR--- | |
cd | |
echo ---PHABRICATOR-Config--- | |
call arc get-config | |
:_menu | |
echo. | |
echo. | |
echo ------------------ | |
echo 请选择要执行的操作 | |
echo ================== | |
echo "1. 提交Phabricator Request" | |
echo "2. 向Subversion分支提交已通过的源码" | |
echo "3. 查看当前项目已提交的Review记录" | |
echo "Q. 退出" | |
echo. | |
echo. | |
:_cho | |
echo "请选择并回车" | |
set choice= | |
set /p choice= | |
if not "%choice%"=="" set choice=%choice:~0,1% | |
if /i "%choice%"=="1" goto _req | |
if /i "%choice%"=="2" goto _cmt | |
if /i "%choice%"=="3" goto _rec | |
if /i "%choice%"=="Q" goto _exit | |
echo 选项无效,请重新选择 | |
echo. | |
goto _cho | |
:_req | |
echo ---REVIEW-ITEMS--- | |
call arc list | |
choice /C YN /M "请确认Review Req是否已经存在上述列表中,避免重复发送审查请求。返回请选C" | |
rem set a=%errorlevel% | |
rem echo %a% | |
if %errorlevel%==1 goto _YES | |
if %errorlevel%==2 goto _NO | |
goto _EOF | |
rem call arc diff affected-files | |
rem choice /C yn /M checked? | |
:_YES | |
echo. | |
echo 提交申请中,请稍候... | |
call arc diff affected-files | |
goto _menu | |
:_NO | |
goto _menu | |
:_cmt | |
echo. | |
choice /C YN /M "是否使用配置中既定的REVISION-ID?若希望重新填写请选N." | |
if %errorlevel%==1 goto _cmt_y | |
if %errorlevel%==2 goto _cmt_n | |
goto _EOF | |
:_cmt_y | |
goto _cmt_go | |
:_cmt_n | |
echo. | |
echo "请填写REVISION-ID" | |
set /p cmt-revision= | |
goto _cmt_go | |
:_cmt_go | |
echo. | |
echo 源码提交SVN中,请稍候... | |
call arc commit --revision %cmt-revision% | |
goto _menu | |
:_rec | |
call arc list | |
goto _menu | |
:_exit | |
exit | |
:_EOF | |
pause | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment