Permalink
Browse files

Fixed bug #19428 : PHPCS Report hgblame doesn't support windows paths

  • Loading branch information...
1 parent b9f57bf commit b178b4fe271a77da60899fa3fdb0f21d50ae8474 @gsherwood gsherwood committed Jun 5, 2012
Showing with 5 additions and 3 deletions.
  1. +3 −3 CodeSniffer/Reports/Hgblame.php
  2. +2 −0 package.xml
View
6 CodeSniffer/Reports/Hgblame.php
@@ -88,13 +88,13 @@ protected function getBlameContent($filename)
echo 'Getting MERCURIAL blame info for '.basename($filename).'... ';
}
- $fileParts = explode('/', $filename);
+ $fileParts = explode(DIRECTORY_SEPARATOR, $filename);
$found = false;
$location = '';
while (empty($fileParts) === false) {
array_pop($fileParts);
- $location = implode($fileParts, '/');
- if (is_dir($location.'/.hg') === true) {
+ $location = implode($fileParts, DIRECTORY_SEPARATOR);
+ if (is_dir($location.DIRECTORY_SEPARATOR.'.hg') === true) {
$found = true;
break;
}
View
2 package.xml
@@ -28,6 +28,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<notes>
- Fixed bug #19416 : Shorthand arrays cause bracket spacing errors
- Fixed bug #19421 : phpcs doesn't recognize ${x} as equivalent to $x
+ - Fixed bug #19428 : PHPCS Report "hgblame" doesn't support windows paths
+ -- Thanks to Justin Rovang for the patch
</notes>
<contents>
<dir name="/">

0 comments on commit b178b4f

Please sign in to comment.