如何使用Reviewboard 1.7和RBTools 0.6来提交代码评论?

5

环境:Git仓库,Reviewboard 1.7,RBTools 0.6

我有一堆已经推送的提交记录,我想为其中某个特定范围的提交记录发布评论,我之前使用过reviewboard的旧版本进行了此操作,使用以下语法:

post-review -o --guess-summary --guess-description --tracking-branch=Dev --revision-range=$firstCommit:$lastCommit

在新版本中,“post-review”脚本已不再受支持,新的语法应该是:

rbt post -d -o -g --branch Dev $firstCommit..$lastCommit

我也尝试了这个选项:$firstCommit:$lastCommit,这个语法对于单个提交可以正常工作,但是对于一段范围却不行:
ERROR: Error uploading diff
The file was not found in the repository (HTTP 400, API Error 207)
Your review request still exists, but the diff is not attached.

我的目标是创建一个评审请求,其中包含从$firstCommit到$lastCommit的所有差异。有什么建议吗?
更新:
这是该命令的调试输出:
>>> RBTools 0.6
>>> Python 2.7.5 (default, Aug 25 2013, 00:04:04) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
>>> Running on Darwin-13.1.0-x86_64-i386-64bit
>>> Home = /Users/
>>> Current directory = /Users/xxxx/Projects/xxxx
>>> Checking for a Subversion repository...
>>> Running: svn info --non-interactive
>>> Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: E155007: '/Users/xxxx/Projects/xxxx' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.master.merge
>>> Running: git config --get branch.master.remote
>>> Running: git config --get remote.xxxx.url
>>> Command exited with rc 1: ['git', 'config', '--get', 'remote.xxxx.url']
---
>>> Running: git config --get remote.xxxx.url
>>> Command exited with rc 1: ['git', 'config', '--get', 'remote.xxxx.url']
---
>>> repository info: Path: /Users/xxxx/Projects/xxxx/.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to  http://reviews.xxxx.com/api/
>>> Making HTTP GET request to http://reviews.xxxx.com/api/info/
>>> Running: git rev-parse dfba187de58bee47677d734a5044e47004c4daea..771ada8a43f1cb1d1f75b16925fc332e8ea8d365
>>> Running: git branch -r --contains dfba187de58bee47677d734a5044e47004c4daea
>>> Running: git diff --no-color --full-index --ignore-submodules --no-renames dfba187de58bee47677d734a5044e47004c4daea..771ada8a43f1cb1d1f75b16925fc332e8ea8d365 -M
>>> Running: git log --reverse --pretty=format:%s%n%n%b ^dfba187de58bee47677d734a5044e47004c4daea 771ada8a43f1cb1d1f75b16925fc332e8ea8d365
>>> Making HTTP GET request to http://reviews.xxxx.com/api/review-requests/
>>> Making HTTP POST request to http://reviews.xxxx.com/api/review-requests/
>>> Making HTTP GET request to http://reviews.xxxx.com/api/review-requests/3373/diffs/
>>> Making HTTP POST request to http://reviews.xxxx.com/api/review-requests/3373/diffs/
>>> Got API Error 207 (HTTP code 400): The file was not found in the repository
>>> Error data: {u'stat': u'fail', u'file': u'xxxx/en.lproj/InfoPlist.strings', u'err': {u'msg': u'The file was not found in the repository', u'code': 207}, u'revision': u''}
Traceback (most recent call last):
  File "/usr/local/bin/rbt", line 8, in <module>
    load_entry_point('RBTools==0.6', 'console_scripts', 'rbt')()
  File "/Library/Python/2.7/site-packages/RBTools-0.6-py2.7.egg/rbtools/commands/main.py", line 134, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/Library/Python/2.7/site-packages/RBTools-0.6-py2.7.egg/rbtools/commands/__init__.py", line 422, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/Library/Python/2.7/site-packages/RBTools-0.6-py2.7.egg/rbtools/commands/post.py", line 769, in main
    submit_as=self.options.submit_as)
  File "/Library/Python/2.7/site-packages/RBTools-0.6-py2.7.egg/rbtools/commands/post.py", line 545, in post_request
    raise CommandError('\n'.join(error_msg))
rbtools.commands.CommandError: Error uploading diff


The file was not found in the repository (HTTP 400, API Error 207)

Your review request still exists, but the diff is not attached.
1个回答

1
如果您在 SVN 服务器上发布到不同的存储库名称,可能会发生这种情况。我听说在 GIT 中重命名也可能会出现这种情况。
例如,像这样的东西:
rbt post -g yes --server https://review.site.net -o --repository mine 如果实际上的 repo 是这样的:
rbt post -g yes --server https://review.site.net -o --repository newmine 在 SVN 中将会失败。
看起来您并没有使用 SVN,而是使用修订版本的增量,但请仔细检查是否有任何相同的重命名。我也为那些在使用 git-svn 时与上游/远程服务器一起工作时遇到相同错误的人提供此答案。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接