win10配置arc:
(1)安装php环境,从该链接 http://windows.php.net/download/ 中下载最新的php版本,可以是zip包。PS:这里要注意下载与操作系统一致的包,否则后续步骤会出现错误,32位系统下载x86的包,64位
系统下载x64的包,线程安全和非安全都可以。
解压压缩包到一个指定的目录(如D:\PHP);
将PHP安装目录(如D:\PHP)加入到PATH环境变量中;
复制php.ini-development文件为php.ini,并且把extension_dir=“ext”前面的 ; 去掉,并且如果找到extension=php_curl.dll、extension=php_mbstring.dll这二行,将行首的分号去掉,如果没有找到,则将这二
行粘贴在php.ini中,否则后面操作会出错。
(2)安装Arcanist及libphutil
libphutil是php的工具集,Arcanist运行需要依赖它。
下载地址:
https://github.com/facebook/arcanist/archive/master.zip
https://github.com/facebook/libphutil/archive/master.zip
下载后解压到指定的Phabricator目录(如D:\phabricator),并把目录名分别修改为arcanist、libphutil,并把arc.bat所在目录(例如D:\phabricator\arcanist\bin)配置到PATH环境变量中。
测试:打开cmd,运行php -i命令。
如果提示了错误:无法启动此程序,因为计算机中丢失 VCRUNTIME140.dll,是因为在Windows下运行php7需要Visual C++Redistributable 2015,去微软官网下载安装程序,安装一遍即可。有64位版和32位
版,根据计算机配置进行下载,下面是下载链接:
64位版下载地址:
32位版下载地址:
下载后根据提示安装即可。
(3)配置arc
在命令行中输入配置命令:arc set-config default $pha-server,例如:
arc set-config default https://phabricator.example.net/
arc install-certificate
# 按照屏幕提示,访问http://phabricator.d.xiaomi.net/conduit/login/,把token copy/paste下来,粘贴在命令行需要输入的位置
(4)配置arc 编辑器(我是配置的notepad++)
arc set-config editor "\"D:\Program Files\Notepad++\notepad++.exe\" -multiInst -nosession"
(5)之后就可以按照arc操作来提交arc diff及load啦。
ubuntu配置arc版本
# 假设是Ubuntu
sudo apt-get install php7.0-cli php7.0-curl php-pear
# 任意其它目录也可以
mkdir ~/phabricator
cd ~/phabricator
git clone https://github.com/facebook/libphutil.git
git clone https://github.com/facebook/arcanist.git
# 编辑~/.bashrc,加入如下一行,之后source ~/.bashrc
export PATH=~/phabricator/arcanist/bin/:${PATH}
# 如果没有项目配置,可以运行下面的命令设置全局的参数:
arc set-config default https://phabricator.example.net/
arc install-certificate
# 按照屏幕提示,访问http://phabricator.d.xiaomi.net/conduit/token/ ,把token copy/paste下来
# 在~/.bashrc里添加下面两行
export EDITOR=vim
alias arc='LC_ALL=C arc'
# 并在命令行执行
source ~/.bashrc
arc操作:
切换到本地的master分支
$ git checkout master
从远端master分支拉代码到本地进行合并
$ git pull origin master
切换到本地的非master分支
$ git checkout sr
将本地仓库的master merge到非master分支
$ git merge master
然后使用arc提交review
$ arc diff master
成功的话,会给个网址,然后点击edit revision,选择review人提交,等待accepted后
$ arc land --onto master
如果成功更好,如果失败且是因为远端库master又做了改变,则:
切换到master分支,git pull origin master后
$ git checkout sr
$ git merge master
$ arc diff --update 之前提交的网址diff后数字
经过review人再次accepted,
$ arcl land --onto master
成功。
PS:如果后面需要修改,请将修改推送到远端分支保存,因为arc不一定什么时候出现错误。arc用到的命令有arc list; arc diff; arc land --onto master; arc diff --update 之前提交的编号