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

login
register
mail settings
Submitter Augie Fackler
Date March 7, 2017, 4:25 p.m.
Message ID <3e82376d7d3f3e11d11f.1488903916@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/18961/
State Superseded
Headers show

Comments

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

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: