Patchwork D9602: errors: raise InputError on recursive template definition

login
register
mail settings
Submitter phabricator
Date Dec. 14, 2020, 9:32 p.m.
Message ID <differential-rev-PHID-DREV-trpc2lbtdrz6shtrdrzb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47898/
State Superseded
Headers show

Comments

phabricator - Dec. 14, 2020, 9:32 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9602

AFFECTED FILES
  mercurial/templater.py
  tests/test-template-basic.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-template-basic.t b/tests/test-template-basic.t
--- a/tests/test-template-basic.t
+++ b/tests/test-template-basic.t
@@ -265,7 +265,7 @@ 
   > EOF
   $ hg log --style ./issue4758
   abort: recursive reference 'changeset' in template
-  [255]
+  [10]
 
  not a recursion if a keyword of the same name exists:
 
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -451,7 +451,7 @@ 
 
 
 def _runrecursivesymbol(context, mapping, key):
-    raise error.Abort(_(b"recursive reference '%s' in template") % key)
+    raise error.InputError(_(b"recursive reference '%s' in template") % key)
 
 
 def buildtemplate(exp, context):