#!/usr/bin/env php setTagline('permanently destroy a Differential Revision'); $args->setSynopsis(<<parseStandardArguments(); $args->parse( array( array( 'name' => 'revision', 'wildcard' => true, ), )); $revisions = $args->getArg('revision'); if (count($revisions) != 1) { $args->printHelpAndExit(); } $id = trim(strtolower(head($revisions)), 'd '); $revision = id(new DifferentialRevision())->load($id); if (!$id) { throw new Exception("No revision '{$id}' exists!"); } $title = $revision->getTitle(); $ok = phutil_console_confirm("Really destroy 'D{$id}: {$title}' forever?"); if (!$ok) { throw new Exception("User aborted workflow."); } $revision->delete(); echo "OK, destroyed revision.\n";