1065: svn file moves/copies/branches don't work

veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 16, 2014
1064, 1234, 1322, 1487, 1617, 1867
Problem closely related to http://code.google.com/p/reviewboard/issues/detail?id=1064

What steps will reproduce the problem?
1. svn checkout http://reviewboard.googlecode.com/svn/trunk/reviewboard 
reviewboard
2. cd reviewboard
3. mkdir newdir
4. svn add newdir
5. svn mv settings.py newdir
6. make changes to newdir/settings.py
7. post-review --server=http://demo.review-board.org

Review only shows the deleted directory (= the original name) + files 
inside. The new directory (and all files inside) are not shown in the 
review request

Draft review of problem here: http://demo.review-board.org/r/1705/diff/

What is the expected output? What do you see instead?
settings.py shown deleted 
settings.py shown added to newdir/settings.py and has local changes diffed 
against trunk/settings.py

What operating system are you using? What browser?
windows xp, RBTools-0.2beta1-py2.5.egg
#1 veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
OOps, a bit of copy-paste error after step 7 :).
Should have said: 
The diff viewer fails to generate a diff for newdir/settings:

/trunk/reviewboard/settings.py
Diff currently unavailable.
Error: The patch to '/trunk/reviewboard/newdir/settings.py' didn't apply cleanly. The 
temporary files have been left in '/tmp/reviewboard.W1fraQ' for debugging purposes. 
`patch` returned: patching file /tmp/reviewboard.W1fraQ/tmphfd4NX Hunk #1 FAILED at 
16. 1 out of 1 hunk FAILED -- saving rejects to file 
/tmp/reviewboard.W1fraQ/tmphfd4NX-new.rej
Details
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/views.py", line 213, in view_diff_fragment
    file = get_requested_diff_file()
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/views.py", line 189, in get_requested_diff_file
    get_chunks)
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/diffutils.py", line 620, in get_diff_files
    large_data=True)
  File "/usr/lib/python2.5/site-packages/Djblets-0.5beta1-
py2.5.egg/djblets/util/misc.py", line 143, in cache_memoize
    data = lookup_callable()
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/diffutils.py", line 619, in <lambda>
    enable_syntax_highlighting),
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/diffutils.py", line 342, in get_chunks
    new = get_patched_file(old, filediff)
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/diffutils.py", line 258, in get_patched_file
    return patch(filediff.diff, buffer, filediff.dest_file)
  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/diffviewer/diffutils.py", line 127, in patch
    (filename, tempdir, patch_output))
Exception: The patch to '/trunk/reviewboard/newdir/settings.py' didn't apply cleanly. 
The temporary files have been left in '/tmp/reviewboard.W1fraQ' for debugging 
purposes.
`patch` returned: patching file /tmp/reviewboard.W1fraQ/tmphfd4NX
Hunk #1 FAILED at 16.
1 out of 1 hunk FAILED -- saving rejects to file /tmp/reviewboard.W1fraQ/tmphfd4NX-
new.rej


#2 veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Just a follow-up. 

If I do
1. svn checkout http://reviewboard.googlecode.com/svn/trunk/reviewboard reviewboard
2. cd reviewboard
3. svn mv settings.py settings_renamed.py
4. post-review --server=http://demo.review-board.org

... I get an review request only containing a deteled settings.py file (the 
settings_renamed.py is not there in the review)

If I do
1. svn checkout http://reviewboard.googlecode.com/svn/trunk/reviewboard reviewboard
2. cd reviewboard
3. svn mv settings.py settings_renamed.py
4. <make some changes to settings_renamed.py>
5. post-review --server=http://demo.review-board.org

... I get settings.py listed twice in the review. The first time is like in the 
previous example (deleted) the next time the lines I changed in settings_renamed.py 
are shown as new changes to settings.py (diffed against settings.py head). 
settings_renamed.py are is never mentioned in the review.

chipx86
#3 chipx86
  • +Confirmed
  • +Milestone-RBTools-Release1.0
    +Component-RBTools
#6 berna******@gmai***** (Google Code) (Is this you? Claim this profile.)
This has to do with SVN diff limitations (to be fixed in SVN 1.8 potentially). But
post-commit *could* try to workaround it in the meantime.

SVN diff only shows modified file content (not directories, not filenames).

If you do a "SVN move" *without* modifying the file, "SVN diff" will not report the
"changes".  So you will only see "deleted content" -- and the new file -- since it
was copied but not modified, will NOT be reported.  The post-commit script -- uses
the output of SVN diff to know which file to process -- it does not do a SVN status
to find what is really happening.

david
#7 david
  • +svn file moves/copies/branches don't work
#11 nikola******@gmai***** (Google Code) (Is this you? Claim this profile.)
Are there any chances for this issue to be fixed soon?
#12 anh****@cisc***** (Google Code) (Is this you? Claim this profile.)
Are any workarounds available for this issue while we wait for a fix?
david
#13 david
  • -Milestone-RBTools-Release1.0
david
#14 david
So this is largely fixed when using rbtools to create and/or post the diffs. 'svn diff' itself creates patch files with bogus revision information.
  • -Confirmed
    +Fixed