4098: [clients/svn] fix convertion to absolute path for removed files

mizhka

What version are you running?

0.7.5

What steps will reproduce the problem?

  1. Create empty repository
  2. Add 2 files, commit them.
  3. Remove first file, update second, commit changes.
  4. Run rbt diff 3

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

File paths must contains /trunk path prefix

Here is actual
Index: 1.lst
===================================================================
--- 1.lst (revision 2)
+++ 1.lst (nonexistent)
@@ -1 +0,0 @@
-test
Index: /trunk/2.lst
===================================================================
--- /trunk/2.lst (revision 2)
+++ /trunk/2.lst (revision 3)
@@ -1 +1,2 @@
new
+new

But expected:
Index: /trunk/1.lst
===================================================================
--- /trunk/1.lst (revision 2)
+++ /trunk/1.lst (nonexistent)
@@ -1 +0,0 @@
-test
Index: /trunk/2.lst
===================================================================
--- /trunk/2.lst (revision 2)
+++ /trunk/2.lst (revision 3)
@@ -1 +1,2 @@
new
+new

What operating system are you using?

FreeBSD 10.2-STABLE, Oracle Enterprise Linux 6.6

Attach the debug out from the command.

$ rbt diff --debug --server reviews.netcracker.com --disable-ssl-verification --username zhilin 3
>>> RBTools 0.7.5
>>> Python 2.7.10 (default, Oct 31 2015, 14:22:34) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)]
>>> Running on FreeBSD-10.2-STABLE-amd64-64bit-ELF
>>> Home = /home/mizhka
>>> Current directory = /usr/home/mizhka/temp/20160201/wc
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> repository info: Path: file:///home/mizhka/temp/20160201/test-repository, Base path: /trunk, Supports changesets: False
>>> Making HTTP GET request to http://reviews.netcracker.com/api/

Please log in to the Review Board server at reviews.netcracker.com.
Password: 
>>> Running: svn --non-interactive log --xml -r 3 -l 1
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> repository info: Path: file:///home/mizhka/temp/20160201/test-repository, Base path: /trunk, Supports changesets: False
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r 2:3
>>> Running: svn --non-interactive info 1.lst
>>> Command exited with rc 1: ['svn', '--non-interactive', 'info', '1.lst']
["svn: warning: W155010: The node '/usr/home/mizhka/temp/20160201/wc/1.lst' was not found.\n", '\n', "svn: E200009: Could not display info for all targets because some targets don't exist\n"]---
>>> Running: svn --non-interactive info 2.lst
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r 2:3 --no-diff-deleted
>>> Running: svn --non-interactive info 1.lst
>>> Command exited with rc 1: ['svn', '--non-interactive', 'info', '1.lst']
["svn: warning: W155010: The node '/usr/home/mizhka/temp/20160201/wc/1.lst' was not found.\n", '\n', "svn: E200009: Could not display info for all targets because some targets don't exist\n"]---
>>> Running: svn --non-interactive info 1.lst
>>> Command exited with rc 1: ['svn', '--non-interactive', 'info', '1.lst']
["svn: warning: W155010: The node '/usr/home/mizhka/temp/20160201/wc/1.lst' was not found.\n", '\n', "svn: E200009: Could not display info for all targets because some targets don't exist\n"]---
>>> Running: svn --non-interactive info 1.lst
>>> Command exited with rc 1: ['svn', '--non-interactive', 'info', '1.lst']
["svn: warning: W155010: The node '/usr/home/mizhka/temp/20160201/wc/1.lst' was not found.\n", '\n', "svn: E200009: Could not display info for all targets because some targets don't exist\n"]---
>>> Running: svn --non-interactive info 2.lst
>>> Running: svn --non-interactive info 2.lst
>>> Running: svn --non-interactive info 2.lst
Index: 1.lst
===================================================================
--- 1.lst   (revision 2)
+++ 1.lst   (nonexistent)
@@ -1 +0,0 @@
-test
Index: /trunk/2.lst
===================================================================
--- /trunk/2.lst    (revision 2)
+++ /trunk/2.lst    (revision 3)
@@ -1 +1,2 @@
 new
+new

Please provide any additional information below.

Here is TC (it's local, but same behaviour with remote SVN servers):

cd /home/mizhka/temp/20160201/ #just to make in any temporary folder
svnadmin create test-repository
mkdir wc
cd wc/
svn import . file:///home/mizhka/temp/20160201/test-repository/trunk -m "Init"
svn checkout file:///home/mizhka/temp/20160201/test-repository/trunk .
svn info
echo test > 1.lst
echo new > 2.lst
svn add 1.lst 
svn add 2.lst
svn commit -m "commit #1"
svn rm 1.lst
rm -rf 1.lst
echo new >> 2.lst 
svn commit -m "BUGGY COMMIT"
svn update
rbt diff --server reviews.netcracker.com --disable-ssl-verification --username zhilin 3

Here is review request:
https://reviews.reviewboard.org/r/7913/