[PATCH 6 of 8 py3] store: give name to lowerencode function

Yuya Nishihara yuya at tcha.org
Sat Sep 16 14:31:30 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1504427170 -32400
#      Sun Sep 03 17:26:10 2017 +0900
# Node ID 1221362d1dbcff390d74307d4339d904e56fa665
# Parent  19726b35322ecc59a3879746ee24a08231d8bf0d
store: give name to lowerencode function

lambda function isn't easy to track in traceback.

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -162,7 +162,9 @@ def _buildlowerencodefun():
         cmap[chr(x)] = "~%02x" % x
     for x in range(ord("A"), ord("Z") + 1):
         cmap[chr(x)] = chr(x).lower()
-    return lambda s: "".join([cmap[c] for c in s])
+    def lowerencode(s):
+        return "".join([cmap[c] for c in s])
+    return lowerencode
 
 lowerencode = getattr(parsers, 'lowerencode', None) or _buildlowerencodefun()
 



More information about the Mercurial-devel mailing list