4

环境:Git 存储库、Reviewboard 1.7、RBTools 0.6

我有一堆已经推送的提交,我想对这些提交的特定范围发表评论,我已经使用以前版本的评论板完成了这个操作,使用以下语法:

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.
4

1 回答 1

1

如果您在 SVN 服务器上发布到与您猜测或指定不同的存储库名称,则可能会发生这种情况。我被告知这也可能发生在 GIT 中的重命名中。

例如像

rbt post -g yes --server https://review.site.net -o --repository mine

如果回购真的会失败

rbt post -g yes --server https://review.site.net -o --repository newmine

在 SVN 中。

看起来您使用的不是 SVN,而是修订版的 delta,但请仔细检查是否有任何看起来相同的重命名。对于在使用 SVN 等上游/远程服务器和使用 git-svn 时遇到相同错误的任何人,我也给出了这个答案。

于 2014-07-24T20:46:26.123 回答