4608: rbt post doesn't show moved/renamed files in review for git-svn repository

theBoss

What version are you running?

0.7.10

What steps will reproduce the problem?

  1. clone repository: git svn clone ...
  2. git mv file file_moved
  3. git commit -m ""
  4. rbt post --summary 'Some summary' --description 'Some description'

What is the expected output? What do you see instead?

Review should be posted and file visible as moved

ERROR: Error validating diff
The specified diff file is empty. (HTTP 400, API Error 219)

What operating system are you using?

Arch Linux

Attach the debug out from the command.

>>> Got API Error 219 (HTTP code 400): The specified diff file is empty.
>>> Error data: {u'stat': u'fail', u'err': {u'msg': u'The specified diff file is empty.', u'code': 219}}
Traceback (most recent call last):
  File "/usr/bin/rbt", line 11, in <module>
    load_entry_point('RBTools==0.7.10', 'console_scripts', 'rbt')()
  File "/usr/lib/python2.7/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/usr/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 663, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/lib/python2.7/site-packages/rbtools/commands/post.py", line 812, in main
    (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

The specified diff file is empty. (HTTP 400, API Error 219)

Please provide any additional information below.

rbt diff shows:

Index: file
===================================================================
similarity index 100%
rename from file
rename to file_moved

If file contains some modifications, all are visible as changes in old name 'file'

theBoss
#1 theBoss

Some more comments, IMHO in this situation diff should looks same as from pure svn, so in diff 'file' should be mareked as removed and file_moved as added.

theBoss
#2 theBoss

Any possibility to fix this?

theBoss
#3 theBoss

bump :/

#4 splatter2

I am having the same issue. This also highlights a discrepancy in the way the ReviewBoard displays diffs between git and svn. In pure git, when a file is moved ReviewBoard (the UI) shows the file one time and marks it as moved. In svn, a moved file will either just show up once and not be marked as moved, or show up twice and be marked as removed/added. There is an svn-specific option (--svn-show-copies-as-adds) for RBTools that controls this. When a file is moved and changed it will be even more confusing in ReviewBoard for svn. If --svn-show-copies-as-adds=y is used, then two copies of the file are shown with no diff to show the change, so ReviewBoard is almost useless for analyzing what changed. If --svn-show-copies-as-adds=n is used then two copies are still shown, but at least once of them shows the rename and diff - which is great. The other copy that shows the file as deleted serves no purpose since the file was already marked as moved.

I think the way that ReviewBoard does it for git is more intuitive. Just show the file once and mark that it was moved (with diffs if applicable). ReviewBoard should behave in the same manner for git, svn, and git-svn.

It would be great if this could be fixed!