getRequest(); if ($request->isFormPost()) { $parser = new ArcanistDiffParser(); $diff = $request->getStr('diff'); $changes = $parser->parseDiff($diff); $diff = DifferentialDiff::newFromRawChanges($changes); $diff->setLintStatus(DifferentialLintStatus::LINT_SKIP); $diff->setUnitStatus(DifferentialLintStatus::LINT_SKIP); $diff->setAuthorPHID($request->getUser()->getPHID()); $diff->setCreationMethod('web'); $diff->save(); return id(new AphrontRedirectResponse()) ->setURI('/differential/diff/'.$diff->getID().'/'); } $form = new AphrontFormView(); $form ->setAction('/differential/diff/create/') ->setUser($request->getUser()) ->appendChild( '
The best way to create a '. 'Differential diff is by using Arcanist, but you '. 'can also just paste a diff (e.g., from svn diff or '. 'git diff) into this box if you really want.
') ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel('Raw Diff') ->setName('diff') ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue("Create Diff \xC2\xBB")); $panel = new AphrontPanelView(); $panel->setHeader('Create New Diff'); $panel->appendChild($form); $panel->setWidth(AphrontPanelView::WIDTH_FORM); return $this->buildStandardPageResponse( $panel, array( 'title' => 'Create Diff', 'tab' => 'create', )); } }