Patchwork [5,of,7] templater: move specialized exception types to top

login
register
mail settings
Submitter Yuya Nishihara
Date Feb. 26, 2018, 2:29 p.m.
Message ID <35263744d42f5a3c60fa.1519655378@mimosa>
Download mbox | patch
Permalink /patch/28411/
State Accepted
Headers show

Comments

Yuya Nishihara - Feb. 26, 2018, 2:29 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1519530473 -32400
#      Sun Feb 25 12:47:53 2018 +0900
# Node ID 35263744d42f5a3c60faec304d044cbee337599d
# Parent  0d70933cd0d82836b9117597b118d72589711118
templater: move specialized exception types to top

I'm going to add one more exception type.

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -30,6 +30,9 @@  from . import (
     util,
 )
 
+class TemplateNotFound(error.Abort):
+    pass
+
 # template parsing
 
 elements = {
@@ -1465,9 +1468,6 @@  def _readmapfile(mapfile):
     aliases.extend(conf['templatealias'].items())
     return cache, tmap, aliases
 
-class TemplateNotFound(error.Abort):
-    pass
-
 class templater(object):
 
     def __init__(self, filters=None, defaults=None, resources=None,