@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix another issue with line order on unified diffs

Summary: This improves some cases with interleaved added and removed lines, and adds test coverage.

Test Plan:
- Added and executed unit tests.
- Viewed raw diff and saw sensible/expected output.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11992

+105 -1
+24
src/applications/differential/__tests__/data/order.diff
··· 1 + diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController b/src/applications/conpherence/controller/ConpherenceUpdateController 2 + --- a/src/applications/conpherence/controller/ConpherenceUpdateController 3 + +++ b/src/applications/conpherence/controller/ConpherenceUpdateController 4 + @@ -209,14 +209,19 @@ 5 + ->setDatasource(new PhabricatorPeopleDatasource())); 6 + 7 + require_celerity_resource('conpherence-update-css'); 8 + - return id(new AphrontDialogView()) 9 + + $view = id(new AphrontDialogView()) 10 + ->setTitle(pht('Add Participants')) 11 + ->addHiddenInput('action', 'add_person') 12 + ->addHiddenInput( 13 + 'latest_transaction_id', 14 + $request->getInt('latest_transaction_id')) 15 + ->appendChild($form); 16 + + 17 + + if ($request->getExists('minimal_display')) { 18 + + $view->addHiddenInput('minimal_display', true); 19 + } 20 + + return $view; 21 + + } 22 + 23 + private function renderRemovePersonDialogue( 24 + ConpherenceThread $conpherence) {
+26
src/applications/differential/__tests__/data/order.diff.one.expect
··· 1 + CTYPE 2 1 (unforced) 2 + src/applications/conpherence/controller/ConpherenceUpdateController 3 + src/applications/conpherence/controller/ConpherenceUpdateController 4 + - 5 + X <MISSING-CONTEXT> 6 + N 209 . ->setDatasource(new PhabricatorPeopleDatasource()));\n~ 7 + N 210 . \n~ 8 + N 211 . require_celerity_resource('conpherence-update-css');\n~ 9 + O 212 - {(return)} id(new AphrontDialogView())\n~ 10 + N 212 + {($view =)} id(new AphrontDialogView())\n~ 11 + N 213 . ->setTitle(pht('Add Participants'))\n~ 12 + N 214 . ->addHiddenInput('action', 'add_person')\n~ 13 + N 215 . ->addHiddenInput(\n~ 14 + N 216 . 'latest_transaction_id',\n~ 15 + N 217 . $request->getInt('latest_transaction_id'))\n~ 16 + N 218 . ->appendChild($form);\n~ 17 + N 219 + \n~ 18 + N 220 + if ($request->getExists('minimal_display')) {\n~ 19 + N 221 + $view->addHiddenInput('minimal_display', true);\n~ 20 + N 222 . }\n~ 21 + N 223 + return $view;\n~ 22 + N 224 + }\n~ 23 + N 225 . \n~ 24 + N 226 . private function renderRemovePersonDialogue(\n~ 25 + N 227 . ConpherenceThread $conpherence) {\n~ 26 + X <MISSING-CONTEXT>
+44
src/applications/differential/__tests__/data/order.diff.two.expect
··· 1 + CTYPE 2 1 (unforced) 2 + src/applications/conpherence/controller/ConpherenceUpdateController 3 + src/applications/conpherence/controller/ConpherenceUpdateController 4 + - 5 + X <MISSING-CONTEXT> 6 + O 209 . ->setDatasource(new PhabricatorPeopleDatasource()));\n~ 7 + N 209 . ->setDatasource(new PhabricatorPeopleDatasource()));\n~ 8 + O 210 . \n~ 9 + N 210 . \n~ 10 + O 211 . require_celerity_resource('conpherence-update-css');\n~ 11 + N 211 . require_celerity_resource('conpherence-update-css');\n~ 12 + O 212 - {(return)} id(new AphrontDialogView())\n~ 13 + N 212 + {($view =)} id(new AphrontDialogView())\n~ 14 + O 213 . ->setTitle(pht('Add Participants'))\n~ 15 + N 213 . ->setTitle(pht('Add Participants'))\n~ 16 + O 214 . ->addHiddenInput('action', 'add_person')\n~ 17 + N 214 . ->addHiddenInput('action', 'add_person')\n~ 18 + O 215 . ->addHiddenInput(\n~ 19 + N 215 . ->addHiddenInput(\n~ 20 + O 216 . 'latest_transaction_id',\n~ 21 + N 216 . 'latest_transaction_id',\n~ 22 + O 217 . $request->getInt('latest_transaction_id'))\n~ 23 + N 217 . $request->getInt('latest_transaction_id'))\n~ 24 + O 218 . ->appendChild($form);\n~ 25 + N 218 . ->appendChild($form);\n~ 26 + O - . ~ 27 + N 219 + \n~ 28 + O - . ~ 29 + N 220 + if ($request->getExists('minimal_display')) {\n~ 30 + O - . ~ 31 + N 221 + $view->addHiddenInput('minimal_display', true);\n~ 32 + O 219 . }\n~ 33 + N 222 . }\n~ 34 + O - . ~ 35 + N 223 + return $view;\n~ 36 + O - . ~ 37 + N 224 + }\n~ 38 + O 220 . \n~ 39 + N 225 . \n~ 40 + O 221 . private function renderRemovePersonDialogue(\n~ 41 + N 226 . private function renderRemovePersonDialogue(\n~ 42 + O 222 . ConpherenceThread $conpherence) {\n~ 43 + N 227 . ConpherenceThread $conpherence) {\n~ 44 + X <MISSING-CONTEXT>
+7
src/applications/differential/render/DifferentialChangesetRenderer.php
··· 522 522 // If this line is the same in both versions of the file, put it in 523 523 // the old line buffer. This makes sure inlines on old, unchanged 524 524 // lines end up in the right place. 525 + 526 + // First, we need to flush the new line buffer if there's anything 527 + // in it. 528 + if ($new_buf) { 529 + $out[] = $new_buf; 530 + $new_buf = array(); 531 + } 525 532 $old_buf[] = $primitive; 526 533 } else { 527 534 $new_buf[] = $primitive;
+4 -1
src/applications/differential/render/DifferentialChangesetTestRenderer.php
··· 92 92 ), 93 93 $render); 94 94 95 - $render = html_entity_decode($render); 95 + $render = html_entity_decode($render, ENT_QUOTES); 96 96 97 97 $t = ($type == 'old') ? 'O' : 'N'; 98 98 99 99 $out[] = "{$t} {$num} {$htype} {$render}~"; 100 + break; 101 + case 'no-context': 102 + $out[] = 'X <MISSING-CONTEXT>'; 100 103 break; 101 104 default: 102 105 $out[] = $type;