[PATCH 2 of 6 py3] extensions: use [0:1] slice on config path instead of [0]

Augie Fackler raf at durin42.com
Tue Mar 7 11:25:16 EST 2017


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1488565930 18000
#      Fri Mar 03 13:32:10 2017 -0500
# Node ID 3e82376d7d3f3e11d11f09fceb8b4c79233057a8
# Parent  48c957d67d0f40a7134aeca72b98c33eb1546f17
extensions: use [0:1] slice on config path instead of [0]

This behaves the same in Python 2 and Python 3, even though the path
is a bytes.

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -160,7 +160,7 @@ def loadall(ui):
     newindex = len(_order)
     for (name, path) in result:
         if path:
-            if path[0] == '!':
+            if path[0:1] == '!':
                 _disabledextensions[name] = path[1:]
                 continue
         try:


More information about the Mercurial-devel mailing list