From 49cf1ca10c0878394362a586e17e68ca31c118b9 Mon Sep 17 00:00:00 2001 From: jungejason Date: Wed, 11 Jan 2012 18:11:43 -0800 Subject: [PATCH] Support deleting individual changeset Summary: add support in purge_cache.php. We might want to add support for maniphest comments and differential comments later. Test Plan: - purging all worked - purging individual changeset worked - when input is not integer, correct error message reported Reviewers: epriestley, btrahan, nh Reviewed By: nh CC: nh, aran, jungejason, epriestley Maniphest Tasks: T683 Differential Revision: https://secure.phabricator.com/D1372 --- scripts/util/purge_cache.php | 49 +++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/scripts/util/purge_cache.php b/scripts/util/purge_cache.php index 8db1063a54..5c8da7b0bb 100755 --- a/scripts/util/purge_cache.php +++ b/scripts/util/purge_cache.php @@ -2,7 +2,7 @@ establishConnection('w'), - 'TRUNCATE TABLE %T', - DifferentialChangeset::TABLE_CACHE); + if ($changesets) { + echo "Purging changeset cache for changesets ". + implode($changesets, ",")."\n"; + queryfx( + $table->establishConnection('w'), + 'DELETE FROM %T WHERE id IN (%Ld)', + DifferentialChangeset::TABLE_CACHE, + $changesets); + } else { + echo "Purging changeset cache...\n"; + queryfx( + $table->establishConnection('w'), + 'TRUNCATE TABLE %T', + DifferentialChangeset::TABLE_CACHE); + } echo "Done.\n"; } @@ -98,7 +118,10 @@ function help() { $help = <<