4527: rbt patch fail when user do svn merge cherry-pick


What version are you running?


What steps will reproduce the problem?

  1. In a feature branch, do svn merge -c <revision> <trunk url>
  2. rbt post --svn-show-copies-as-adds=y
  3. In a clean checkout of feature branch, do rbt patch <review request id>

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

Expected Result: Should be able to patch the diff.
Actual Result: rbt patch failed.
Error is:
svn: E000021: Can't move '/home/devops/jenkins_slave/workspace/ReviewBoard/ReviewBoard_Commit/FortiSwitchOS v3.00/svn-qdo28p' to '/home/devops/jenkins_slave/workspace/ReviewBoard/ReviewBoard_Commit/FortiSwitchOS v3.00/3.5': Is a directory

What operating system are you using?

Ubuntu 14.04

Attach the debug out from the command.

$ rbt patch --debug <args>
Debug log attached

Please provide any additional information below.

When svn merge -c is used, when rbt post, it somehow knows it's a merge so rbt modifies the file path. For example, the diff from rbt post would look something like this:

Index: /ABC/branches/3.x/3.5/trunk/cooked/cert/802.1x.crt

--- /ABC/trunk/cooked/cert/802.1x.crt (nonexistent)
+++ /ABC/branches/3.x/3.5/trunk/cooked/cert/802.1x.crt (working copy)

Somehow rbt knows it's merge from trunk to 3.5 branch, so it modified the path in the diff. When I run rbt patch, then it will fail.

Eventually I had to manually modify the diff file to the following for it to work:
Index: /ABC/branches/3.x/3.5/trunk/cooked/cert/802.1x.crt
--- /ABC/branches/3.x/3.5/trunk/cooked/cert/802.1x.crt (nonexistent)
+++ /ABC/branches/3.x/3.5/trunk/cooked/cert/802.1x.crt (working copy)

>>> Command line: rbt patch --debug --username=build --password ******** 101312
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> repository info: Path: http://scm-yvr.fortinet.com/svn/svnfos, Base path: /FortiSwitchOS/branches/3.x/3.5/trunk, Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.corp.fortinet.com/api/
>>> Making HTTP GET request to http://reviewboard.corp.fortinet.com/api/repositories/?tool=Subversion
>>> Cached response for HTTP GET http://reviewboard.corp.fortinet.com/api/repositories/?tool=Subversion expired and was modified
>>> Making HTTP GET request to http://reviewboard.corp.fortinet.com/api/review-requests/101312/diffs/
>>> Cached response for HTTP GET http://reviewboard.corp.fortinet.com/api/review-requests/101312/diffs/ expired and was modified
>>> Making HTTP GET request to http://reviewboard.corp.fortinet.com/api/review-re
#1 jackdai

We are encountering this issue as well, rbt patch will fail when the changes were from svn merge.