diff --git a/src/applications/releeph/controller/project/ReleephProjectEditController.php b/src/applications/releeph/controller/project/ReleephProjectEditController.php index 9dd7f7588c..0cdeae35d6 100644 --- a/src/applications/releeph/controller/project/ReleephProjectEditController.php +++ b/src/applications/releeph/controller/project/ReleephProjectEditController.php @@ -252,18 +252,15 @@ final class ReleephProjectEditController extends ReleephController { $commit_author_inset = $this->buildCommitAuthorInset($commit_author); // Build the Template inset - $markup_engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine(); - - // From DifferentialUnitFieldSpecification... - $markup_engine->setConfig('viewer', $request->getUser()); - $help_markup = phutil_tag( 'div', array( 'class' => 'phabricator-remarkup', ), - phutil_safe_html( - $markup_engine->markupText(ReleephBranchTemplate::getHelpRemarkup()))); + PhabricatorMarkupEngine::renderOneObject( + new ReleephBranchTemplate(), + 'field', + $request->getUser())); $branch_template_input = id(new AphrontFormTextControl()) ->setName('branchTemplate') diff --git a/src/applications/releeph/view/branch/ReleephBranchTemplate.php b/src/applications/releeph/view/branch/ReleephBranchTemplate.php index cef13ee256..1936b7fcad 100644 --- a/src/applications/releeph/view/branch/ReleephBranchTemplate.php +++ b/src/applications/releeph/view/branch/ReleephBranchTemplate.php @@ -1,6 +1,7 @@ releases/2012-30-16-rHERGE32cd512a52b7 - -Include a second hierarchy if you share your repository with other projects: - - lang=none - releases/%P/%p-release-%Y%m%d-%V - => releases/Tintin/tintin-release-20121116-32cd512a52b7 - -Keep your branch names simple, avoiding strange punctuation, most of which is -forbidden or escaped anyway: - - lang=none, counterexample - releases//..clown-releases..//`date --iso=seconds`-$(sudo halt) - -Include the date early in your template, in an order which sorts properly: - - lang=none - releases/%Y%m%d-%v - => releases/20121116-rHERGE32cd512a52b7 (good!) - - releases/%V-%m.%d.%Y - => releases/32cd512a52b7-11.16.2012 (awful!) - - -EOTEXT - ; - } - /* * xsprintf() would be useful here, but that's for formatting concrete lists * of things in a certain way... @@ -238,4 +187,82 @@ EOTEXT return $errors; } +/* -( Help Text and Markup Interface )------------------------------------- */ + + public function getMarkupFieldKey($field) { + $text = $this->getMarkupText($field); + return sprintf( + '%s:%s', + get_class($this), + PhabricatorHash::digest($text)); + } + + public function newMarkupEngine($field) { + return PhabricatorMarkupEngine::newDifferentialMarkupEngine(); + } + + public function didMarkupText( + $field, + $output, + PhutilMarkupEngine $engine) { + + return $output; + } + + public function shouldUseMarkupCache($field) { + return true; + } + + public function getMarkupText($field) { + return << releases/2012-30-16-rHERGE32cd512a52b7 + +Include a second hierarchy if you share your repository with other projects: + + lang=none + releases/%P/%p-release-%Y%m%d-%V + => releases/Tintin/tintin-release-20121116-32cd512a52b7 + +Keep your branch names simple, avoiding strange punctuation, most of which is +forbidden or escaped anyway: + + lang=none, counterexample + releases//..clown-releases..//`date --iso=seconds`-$(sudo halt) + +Include the date early in your template, in an order which sorts properly: + + lang=none + releases/%Y%m%d-%v + => releases/20121116-rHERGE32cd512a52b7 (good!) + + releases/%V-%m.%d.%Y + => releases/32cd512a52b7-11.16.2012 (awful!) + + +EOTEXT + ; + } + }