1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-12 18:02:40 +01:00

Change fileName to filename

Summary: There are lots of callsites to $changeset->getFilename() so it seemed
easier to rename getFileName() to getFilename() even if it includes database
change. Plus I think that getFilename() is better.

Test Plan:
Alter database.
Open revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D1437
This commit is contained in:
vrana 2012-01-16 23:05:44 -08:00
parent ae0d9770a5
commit 6472dbe168
10 changed files with 19 additions and 17 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE phabricator_differential.differential_changeset
CHANGE fileName filename varchar(255) NOT NULL;

View file

@ -244,7 +244,7 @@ class DifferentialChangesetViewController extends DifferentialController {
$inlines = array(); $inlines = array();
foreach ($lint as $msg) { foreach ($lint as $msg) {
if ($msg['path'] != $changeset->getFileName()) { if ($msg['path'] != $changeset->getFilename()) {
continue; continue;
} }
$inline = new DifferentialInlineComment(); $inline = new DifferentialInlineComment();

View file

@ -654,7 +654,7 @@ class DifferentialRevisionViewController extends DifferentialController {
$indexed_langs = array_fill_keys($langs, true); $indexed_langs = array_fill_keys($langs, true);
foreach ($visible_changesets as $key => $changeset) { foreach ($visible_changesets as $key => $changeset) {
$lang = $engine->getLanguageFromFilename($changeset->getFileName()); $lang = $engine->getLanguageFromFilename($changeset->getFilename());
if (isset($indexed_langs[$lang])) { if (isset($indexed_langs[$lang])) {
$symbol_indexes[$key] = array( $symbol_indexes[$key] = array(
'lang' => $lang, 'lang' => $lang,

View file

@ -779,7 +779,7 @@ class DifferentialRevisionEditor {
$paths = array(); $paths = array();
foreach ($changesets as $changeset) { foreach ($changesets as $changeset) {
$paths[] = $path_prefix.'/'.$changeset->getFileName(); $paths[] = $path_prefix.'/'.$changeset->getFilename();
} }
// Mark this as also touching all parent paths, so you can see all pending // Mark this as also touching all parent paths, so you can see all pending

View file

@ -33,7 +33,7 @@ final class DifferentialLintFieldSpecification
public function renderValueForRevisionView() { public function renderValueForRevisionView() {
$diff = $this->getDiff(); $diff = $this->getDiff();
$path_changesets = mpull($diff->loadChangesets(), 'getId', 'getFileName'); $path_changesets = mpull($diff->loadChangesets(), 'getId', 'getFilename');
$lstar = DifferentialRevisionUpdateHistoryView::renderDiffLintStar($diff); $lstar = DifferentialRevisionUpdateHistoryView::renderDiffLintStar($diff);
$lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff); $lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff);

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@ class DifferentialChangeset extends DifferentialDAO {
protected $diffID; protected $diffID;
protected $oldFile; protected $oldFile;
protected $fileName; protected $filename;
protected $awayPaths; protected $awayPaths;
protected $changeType; protected $changeType;
protected $fileType; protected $fileType;
@ -155,7 +155,7 @@ class DifferentialChangeset extends DifferentialDAO {
$base = id(new PhutilURI($diff->getSourceControlPath()))->getPath(); $base = id(new PhutilURI($diff->getSourceControlPath()))->getPath();
} }
$path = $this->getFileName(); $path = $this->getFilename();
$path = rtrim($base, '/').'/'.ltrim($path, '/'); $path = rtrim($base, '/').'/'.ltrim($path, '/');
$vcs = $repository->getVersionControlSystem(); $vcs = $repository->getVersionControlSystem();
@ -177,7 +177,7 @@ class DifferentialChangeset extends DifferentialDAO {
public function getWordWrapWidth() { public function getWordWrapWidth() {
$config = PhabricatorEnv::getEnvConfig('differential.wordwrap'); $config = PhabricatorEnv::getEnvConfig('differential.wordwrap');
foreach ($config as $regexp => $width) { foreach ($config as $regexp => $width) {
if (preg_match($regexp, $this->getFileName())) { if (preg_match($regexp, $this->getFilename())) {
return $width; return $width;
} }
} }
@ -187,7 +187,7 @@ class DifferentialChangeset extends DifferentialDAO {
public function getWhitespaceMatters() { public function getWhitespaceMatters() {
$config = PhabricatorEnv::getEnvConfig('differential.whitespace-matters'); $config = PhabricatorEnv::getEnvConfig('differential.whitespace-matters');
foreach ($config as $regexp) { foreach ($config as $regexp) {
if (preg_match($regexp, $this->getFileName())) { if (preg_match($regexp, $this->getFilename())) {
return true; return true;
} }
} }

View file

@ -186,7 +186,7 @@ class DifferentialDiff extends DifferentialDAO {
$change = array( $change = array(
'metadata' => $changeset->getMetadata(), 'metadata' => $changeset->getMetadata(),
'oldPath' => $changeset->getOldFile(), 'oldPath' => $changeset->getOldFile(),
'currentPath' => $changeset->getFileName(), 'currentPath' => $changeset->getFilename(),
'awayPaths' => $changeset->getAwayPaths(), 'awayPaths' => $changeset->getAwayPaths(),
'oldProperties' => $changeset->getOldProperties(), 'oldProperties' => $changeset->getOldProperties(),
'newProperties' => $changeset->getNewProperties(), 'newProperties' => $changeset->getNewProperties(),

View file

@ -177,7 +177,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
$inline_render[] = $inline_render[] =
'<tr>'. '<tr>'.
'<th colspan="3">'. '<th colspan="3">'.
phutil_escape_html($changeset->getFileName()). phutil_escape_html($changeset->getFilename()).
'</th>'. '</th>'.
'</tr>'; '</tr>';
foreach ($inlines as $inline) { foreach ($inlines as $inline) {

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,7 +23,7 @@ class PhabricatorMetaMTAAttachment {
public function __construct($data, $filename, $mimetype) { public function __construct($data, $filename, $mimetype) {
$this->setData($data); $this->setData($data);
$this->setFileName($filename); $this->setFilename($filename);
$this->setMimeType($mimetype); $this->setMimeType($mimetype);
} }
@ -36,11 +36,11 @@ class PhabricatorMetaMTAAttachment {
return $this; return $this;
} }
public function getFileName() { public function getFilename() {
return $this->filename; return $this->filename;
} }
public function setFileName($filename) { public function setFilename($filename) {
$this->filename = $filename; $this->filename = $filename;
return $this; return $this;
} }

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -326,7 +326,7 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
foreach ($value as $attachment) { foreach ($value as $attachment) {
$mailer->addAttachment( $mailer->addAttachment(
$attachment->getData(), $attachment->getData(),
$attachment->getFileName(), $attachment->getFilename(),
$attachment->getMimeType() $attachment->getMimeType()
); );
} }