在svn分支和标记板上张贴差异 [英] post a diff between svn branch and a tag on review board

查看:87
本文介绍了在svn分支和标记板上张贴差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SVN差异发布到审查委员会;差异是在HEAD分支和基本标签之间生成的.

I want to post an SVN diff to the review board; the diff is generated between the branch HEAD and the base tag.

我使用此命令生成了diff文件:

I used this command to generate the diff file :

svn diff https:/path/to/branch/head https:/path/to/tag

请注意

  • 我尝试使用rbt diff revision1:revision2命令生成差异.我有一个问题,就是评审委员会仅接受分支提交内的修订范围(不接受来自标签的修订).

  • i tried to use rbt diff revision1:revision2 command to generate the diff. I have a problem that review board only accepts revision range within the branch commits only (not accepting revision from tags).

我尝试使用svn diff命令进行差异化,然后使用rbt post --diff-filename上传文件,但是该命令返回,但错误,需要基本目录;我使用rbt post --basedir https:/path/to/root将基本目录添加为根目录;审查委员会接受但在网页上显示差异,就像https:/path/to/root/branches/featureName/path/to/changed/fileshttps:/path/to/root/path/to/changed/files之间的差异一样,而没有显示差异在分支和https:/path/to/root/tag/path/to/changed/files之类的标签之间.

i tried to diff using the svn diff command then upload the file using rbt post --diff-filename but the command returned with an error requiring a base directory; i added the base dir to to be the root using rbt post --basedir https:/path/to/root ; the review boards accept but shows the diff on the web page like a diff between https:/path/to/root/branches/featureName/path/to/changed/files and https:/path/to/root/path/to/changed/files without showing that the diff is between branch and a tag like https:/path/to/root/tag/path/to/changed/files.

有什么办法做这样的工作吗?

is there any way to do such job ?

推荐答案

您可以使用 RBTools post命令.

例如,您的Subversion存储库在审阅委员会上使用以下URL注册:

Say, for example, your Subversion repository is registered with following URL at review board:

http://svn.example.org/foo/base/group

(其中foo是噪音,base是存储库的基础)

(where foo is noise and base is the base of your repository)

那么我们假设我们有两个标签

Then let's assume that we have two tags

http://svn.example.org/foo/base/group/module/tag/abc1
http://svn.example.org/foo/base/group/module/tag/abc2

其中abc2基于abc1,并进行了一些更改.

where abc2 is based on abc1 and introduces some changes.

要为这些更改创建审阅请求,首先,我们使用Subversion进行比较:

To create a review request for those changes, first, we make a diff with Subversion:

base=http://svn.example.org/foo/base/group
svn diff $base/module/tag/abc1 $base/module/tag/abc2 \
  > --patch-compatible > change_xyz.diff

我们可以使用rbt post发布差异,但是为此,我们需要一个Subversion工作目录.一个空的就足够了:

We can post the diff with rbt post, but for that, we need a Subversion working directory. An empty one is sufficient:

svn co --depth=empty $base
cd group

rbt命令需要一些配置,以简化操作,用户名/密码也可以存储在运行控制文件中,例如:

The rbt command needs some configuration, to simplify things username/password can also be stored in a run control file, e.g.:

cat > .reviewboardrc <<EOF
REVIEWBOARD_URL = 'http://reviewboard.example.org/'
REPOSITORY = 'somerepo'
PASSWORD = 'einsfueralles'
USERNAME = 'juser'
EOF

发布差异文件时,rbt会根据工作目录解析差异文件中的相对路径,因此我们必须使用--basedir选项添加缺少的部分:

When posting the diff the rbt resolves the relative paths in the diff file against the working directory, thus we have to add missing parts with the --basedir option:

rbt post --diff-filename ../change_xyz.diff --basedir module/tag

如果一切正常,rbt将diff和引用的文件上传到新的草稿并打印新的URL,例如:

If everything works ok, rbt uploads the diff and the referenced files to a new draft and prints the new URLs, e.g.:

http://reviewboard.example.org/r/23/
http://reviewboard.example.org/r/23/diff/

然后可以编辑草稿并最终通过Web UI发布. rbt post命令还具有几个选项,可以添加其他数据(例如--summary--description)和/或直接发布(参见--publish).

The draft can then be edited and finally published via the web UI. The rbt post command also has several options to add additional data (e.g. --summary, --description) and/or directly publish it (cf. --publish).

这篇关于在svn分支和标记板上张贴差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆