Patchwork [2,of,7] util: mark filtertable as private constant

login
register
mail settings
Submitter Yuya Nishihara
Date March 25, 2018, 3:36 a.m.
Message ID <4bd2d19ecff7aa5ce3ce.1521948976@mimosa>
Download mbox | patch
Permalink /patch/29832/
State Accepted
Headers show

Comments

Yuya Nishihara - March 25, 2018, 3:36 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1521869914 -32400
#      Sat Mar 24 14:38:34 2018 +0900
# Node ID 4bd2d19ecff7aa5ce3ce695427a478b9d3be9ff1
# Parent  348e7462944f36f0fbea25bcf407c78d68aeaa1f
util: mark filtertable as private constant

Prepares for porting to utils.*.

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1541,14 +1541,14 @@  def tempfilter(s, cmd):
         except OSError:
             pass
 
-filtertable = {
+_filtertable = {
     'tempfile:': tempfilter,
     'pipe:': pipefilter,
-    }
+}
 
 def filter(s, cmd):
     "filter a string through a command that transforms its input to its output"
-    for name, fn in filtertable.iteritems():
+    for name, fn in _filtertable.iteritems():
         if cmd.startswith(name):
             return fn(s, cmd[len(name):].lstrip())
     return pipefilter(s, cmd)