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

login
register
mail settings
Submitter Augie Fackler
Date March 8, 2017, 11:22 p.m.
Message ID <009c8aeb34d4f226ba15.1489015361@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/19032/
State Accepted
Headers show

Comments

Augie Fackler - March 8, 2017, 11:22 p.m.
# HG changeset patch
# User Augie Fackler <raf@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.

Patch

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: