From acbb46dc3db13708495a81b812dc22fdc1abb442 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 23 Apr 2015 10:19:00 +0000 Subject: [PATCH] fixed the LOC-by-file function to use the full path as a node name --- codepot/src/codepot/models/subversionmodel.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 68e8d7cd..aaae6ade 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -1032,7 +1032,7 @@ class SubversionModel extends Model $stack = array(); $cloc = new stdClass(); - $cloc->name = basename($path); + $cloc->name = $path; if ($cloc->name == '') $cloc->name = '/'; $cloc->children = array(); @@ -1082,7 +1082,8 @@ class SubversionModel extends Model if ($value['type'] == 'file') { $obj = new stdClass(); - $obj->name = $key; + //$obj->name = $key; + $obj->name = $full_path; $text = @svn_cat ("{$orgurl}/{$key}{$trailer}", $rev); if ($text === FALSE) $obj->size = 0; @@ -1102,7 +1103,13 @@ class SubversionModel extends Model else { $obj = new stdClass(); - $obj->name = $key; + // using the base name only caused some wrong linkages + // in the graph when the base name coflicted with + // other same base name in a different directory. + // let's use a full path. it's anyway clearer. + //$obj->name = $key; + $obj->name = $full_path; + $obj->children = array(); array_push ($current_cloc->children, $obj);