getChangeset(); $change = $changeset->getChangeType(); $file = $changeset->getFileType(); $message = null; if ($change == DifferentialChangeType::TYPE_CHANGE && $file == DifferentialChangeType::FILE_TEXT) { if ($force) { // We have to force something to render because there were no changes // of other kinds. $message = pht('This file was not modified.'); } else { // Default case of changes to a text file, no metadata. return null; } } else { switch ($change) { case DifferentialChangeType::TYPE_ADD: switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was added.'); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This image was added.'); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This directory was added.'); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This binary file was added.'); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This symlink was added.'); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This submodule was added.'); break; } break; case DifferentialChangeType::TYPE_DELETE: switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was deleted.'); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This image was deleted.'); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This directory was deleted.'); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This binary file was deleted.'); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This symlink was deleted.'); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This submodule was deleted.'); break; } break; case DifferentialChangeType::TYPE_MOVE_HERE: $from = "". phutil_escape_html($changeset->getOldFile()). ""; switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was moved from %s.', $from); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This image was moved from %s.', $from); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This directory was moved from %s.', $from); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This binary file was moved from %s.', $from); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This symlink was moved from %s.', $from); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This submodule was moved from %s.', $from); break; } break; case DifferentialChangeType::TYPE_COPY_HERE: $from = "". phutil_escape_html($changeset->getOldFile()). ""; switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was copied from %s.', $from); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This image was copied from %s.', $from); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This directory was copied from %s.', $from); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This binary file was copied from %s.', $from); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This symlink was copied from %s.', $from); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This submodule was copied from %s.', $from); break; } break; case DifferentialChangeType::TYPE_MOVE_AWAY: $paths = "". phutil_escape_html(implode(', ', $changeset->getAwayPaths())). ""; switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was moved to %s.', $paths); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This image was moved to %s.', $paths); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This directory was moved to %s.', $paths); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This binary file was moved to %s.', $paths); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This symlink was moved to %s.', $paths); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This submodule was moved to %s.', $paths); break; } break; case DifferentialChangeType::TYPE_COPY_AWAY: $paths = "". phutil_escape_html(implode(', ', $changeset->getAwayPaths())). ""; switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This file was copied to %s.', $paths); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This image was copied to %s.', $paths); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This directory was copied to %s.', $paths); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This binary file was copied to %s.', $paths); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This symlink was copied to %s.', $paths); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This submodule was copied to %s.', $paths); break; } break; case DifferentialChangeType::TYPE_MULTICOPY: $paths = "". phutil_escape_html(implode(', ', $changeset->getAwayPaths())). ""; switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht( 'This file was deleted after being copied to %s.', $paths); break; case DifferentialChangeType::FILE_IMAGE: $message = pht( 'This image was deleted after being copied to %s.', $paths); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht( 'This directory was deleted after being copied to %s.', $paths); break; case DifferentialChangeType::FILE_BINARY: $message = pht( 'This binary file was deleted after being copied to %s.', $paths); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht( 'This symlink was deleted after being copied to %s.', $paths); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht( 'This submodule was deleted after being copied to %s.', $paths); break; } break; default: switch ($file) { case DifferentialChangeType::FILE_TEXT: $message = pht('This is a file.'); break; case DifferentialChangeType::FILE_IMAGE: $message = pht('This is an image.'); break; case DifferentialChangeType::FILE_DIRECTORY: $message = pht('This is a directory.'); break; case DifferentialChangeType::FILE_BINARY: $message = pht('This is a binary file.'); break; case DifferentialChangeType::FILE_SYMLINK: $message = pht('This is a symlink.'); break; case DifferentialChangeType::FILE_SUBMODULE: $message = pht('This is a submodule.'); break; } break; } } return '
'; } protected function renderPropertyChangeHeader() { $changeset = $this->getChangeset(); $old = $changeset->getOldProperties(); $new = $changeset->getNewProperties(); $keys = array_keys($old + $new); sort($keys); $rows = array(); foreach ($keys as $key) { $oval = idx($old, $key); $nval = idx($new, $key); if ($oval !== $nval) { if ($oval === null) { $oval = 'null'; } else { $oval = nl2br(phutil_escape_html($oval)); } if ($nval === null) { $nval = 'null'; } else { $nval = nl2br(phutil_escape_html($nval)); } $rows[] = 'Property Changes | '. 'Old Value | '. 'New Value | '. '
---|