From a6b1fac1172c4acdd9eadfabd84fd410b7520a5c Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 1 Apr 2014 08:23:48 -0700 Subject: [PATCH] Fix SVN translation of "add-file" protocol frames over SSH Summary: Fixes T4697. When pushing moved/copied files, SVN sends an "add-file" protocol frame which has a URI in it that needs translation from external format ("/diffusion/X/") to internal format ("/path/to/svn"). Test Plan: - Copied/moved files and committed them in SVN. - Added files (no copy/move) and committed them in SVN. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T4697 Differential Revision: https://secure.phabricator.com/D8654 --- .../ssh/DiffusionSSHSubversionServeWorkflow.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php index e03dc76967..09315d1ef8 100644 --- a/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php @@ -121,6 +121,15 @@ final class DiffusionSSHSubversionServeWorkflow $struct[1]['value'][4]['value']); $message_raw = $proto->serializeStruct($struct); break; + case 'add-file': + // ( add-file ( path dir-token file-token [ copy-path copy-rev ] ) ) + if (isset($struct[1]['value'][3]['value'][0]['value'])) { + $copy_from = $struct[1]['value'][3]['value'][0]['value']; + $copy_from = $this->makeInternalURI($copy_from); + $struct[1]['value'][3]['value'][0]['value'] = $copy_from; + } + $message_raw = $proto->serializeStruct($struct); + break; } }