1.安装Arcanist
下面只是摘取上面链接比较重要的翻译了一下。
·安装php
首先安装php5.2以上,并设置好环境变量。
控制台 php –version 查看本机是否安装php,以及php版本。
$ php --version
PHP 5.5.20 (cli) (built: Feb 25 2015 23:30:53)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
·安装Arcanist
some_install_path/ $ git clone https://github.com/phacility/libphutil.git
some_install_path/ $ git clone https://github.com/phacility/arcanist.git
目录结构看起来是这样
some_install_path/ # Wherever you chose to install it.
arcanist/ # Arcanist-specific code and libraries.
libphutil/ # A shared library Arcanist depends upon.
然后把some_install_path/arcanist/bin/
添加到环境变量,可以在 ~/.bash_profile 或者 ~/.profile path后面添加
类似:
export PATH=”$PATH:pathToYourArcanistBinDirectory”
比如我的:
export PATH="$PATH:$HOME/.rvm/bin:$HOME/Library/Arcanist/arcanist/bin" # Add RVM to PATH for scripting
然后
$source ~/.bash_profile
or
$source ~/.profile
然后在控制台测试arc是否安装好
$ arc --version
arcanist 6f7bedaceb6857a084b4914679a43fdedfb720da (5 May 2015)
libphutil cb8cdccb1a50190fd42546878fe29ccb7e593876 (5 May 2015)
如果有类似此内容输出则代表安装并配置好了。
需要升级时可以使用:
arc upgrade
·在工程配置Arcanist
官方指引
进入你的working copy,比如我的
$HOME/entmobile-ios_littleartist_feature
然后 vim .arccomfig
编辑如下内容
{
"project.name":"entmobile ios",
"phabricator.uri":"http://phabricator.yy.com",
"repository.callsign":"ENTMOBILEIOS"
}
project.name 跟服务器已经配置的 entmobile ios 绑定(以后如果新建了,这里可以更改)
phabricator.uri 服务器配置的域名 http://phabricator.yy.com (不可更改,除非变了域名)
repository.callsign 跟服务器已经配置的repository 的 callsign绑定 (以后如果新建了,这里可以更改)
还有很多其他 自定义的配置,可以参考前面的官方指引
原指导网站,指出此配置文件应该提交到svn,但是目前建议自己配置到本地,等大部分配置的内容弄清楚后 而且这个工具稳定后,再由该分支负责人提交。
3.使用Arcanist 进行提交
本地文件有改动准备提交时,可以自己先在cornerstone进行diff查看一下。
确认要提交了。进入控制台(在某个workong copy
)
tutumagideMBP:entmobile-ios_littleartist_feature $ arc diff
You have untracked files in this working copy.
Working copy: /Users/tufei/developer/workproj/mobile/entmobile/ios/branches/entmobile-ios_littleartist_feature/
Untracked changes in working copy:
(To ignore this change, add it to "svn:ignore".)
.arcconfig
Ignore this untracked file and continue? [y/N] y
<<Replace this line with your Revision Title>>
Summary: //填写你本次提交的细节
Test Plan: //需要跑的测试用例,我们目前没有,这个可以填NO
Reviewers: //填写reviewer的人,必须是在此Phabricator上注册的用户名(所以推荐大家注册时使用和邮箱一样的名字,比如 tufei,fangyang,lijin2等等)
Subscribers: //此次提交的订阅者,比如这次提交过程(review + commit),让哪些人看到这次过程,比如一个需求,A,B,C三个人开发,D是reviewer,A在提交一次改动时可以吧A,B,C都添加进去
//如果本次提交通过了,然后本地使用arc commit,上面的信息会填进commit log
//下面这些不会填进commit log,这些只是工具的一些提示
# Tip: You can add a project as a subscriber or reviewer by writing
# "#projectname" in the appropriate field.
# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
# $ arc diff --update <revision>