问题
I want to post an SVN diff to the review board; the diff is generated between the branch HEAD and the base tag.
I used this command to generate the diff file :
svn diff https:/path/to/branch/head https:/path/to/tag
note that
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).i tried to diff using the
svn diff
command then upload the file usingrbt post --diff-filename
but the command returned with an error requiring a base directory; i added the base dir to to be the root usingrbt post --basedir https:/path/to/root
; the review boards accept but shows the diff on the web page like a diff betweenhttps:/path/to/root/branches/featureName/path/to/changed/files
andhttps:/path/to/root/path/to/changed/files
without showing that the diff is between branch and a tag likehttps:/path/to/root/tag/path/to/changed/files
.
is there any way to do such job ?
回答1:
You can post such a diff with the RBTools post
command.
Say, for example, your Subversion repository is registered with following URL at review board:
http://svn.example.org/foo/base/group
(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
where abc2
is based on abc1
and introduces some changes.
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
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
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
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
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/
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
).
来源:https://stackoverflow.com/questions/31676061/post-a-diff-between-svn-branch-and-a-tag-on-review-board