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

Augie Fackler raf at durin42.com
Wed Mar 8 18:22:41 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 009c8aeb34d4f226ba15c54b37dbe8fb86cc103b
# Parent  6305f423089ed14fbf77a0311b5ce472fd1e1d0d
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