From eb142f5bb754d2149d89a785657e03b4795288fc Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 5 Feb 2015 08:20:45 +0000 Subject: [PATCH] enhanced subversion model to to retry with a pegged url when calling svn_cat() for diffing --- codepot/src/codepot/models/subversionmodel.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 79f9d344..18ce9992 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -646,11 +646,21 @@ class SubversionModel extends Model $old_text = @svn_cat ($info2[0]['url'], $info2[0]['revision']); if ($old_text === FALSE) { - // if the old URL can't give the contents, - // try it with the latest url and the old revision number - $old_text = @svn_cat ($info1[0]['url'], $info2[0]['revision']); + $pegged_url = $info2[0]['url'] . '@' . $info2[0]['revision']; + $old_text = @svn_cat ($pegged_url, $info2[0]['revision']); + if ($old_text === FALSE) + { + // if the old URL can't give the contents, + // try it with the latest url and the old revision number + $old_text = @svn_cat ($info1[0]['url'], $info2[0]['revision']); + } } $new_text = @svn_cat ($info1[0]['url'], $info1[0]['revision']); + if ($new_text == FALSE) + { + $pegged_url = $info1[0]['url'] . '@' . $info1[0]['revision']; + $new_text = @svn_cat ($pegged_url, $info1[0]['revision']); + } $fileinfo['content'] = $this->_get_diff ($diff, $old_text, $new_text, TRUE, FALSE); } else