Submitter | Yuya Nishihara |
---|---|
Date | Sept. 3, 2017, 2:36 p.m. |
Message ID | <6f837717bec80a273aa7.1504449384@mimosa> |
Download | mbox | patch |
Permalink | /patch/23645/ |
State | Accepted |
Headers | show
Return-Path: <mercurial-devel-bounces@mercurial-scm.org> X-Original-To: patchwork@mercurial-scm.org Delivered-To: patchwork@mercurial-scm.org Received: from localhost (localhost [127.0.0.1]) by mercurial-scm.org (Postfix) with ESMTP id 957C92C2A7; Sun, 3 Sep 2017 10:36:46 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at mercurial-scm.org Received: from mercurial-scm.org ([127.0.0.1]) by localhost (mercurial-scm.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nmdLRfyPWyyW; Sun, 3 Sep 2017 10:36:46 -0400 (EDT) Received: from mercurial-scm.org (localhost [IPv6:::1]) by mercurial-scm.org (Postfix) with ESMTP id 2E9402C2A4; Sun, 3 Sep 2017 10:36:44 -0400 (EDT) X-Original-To: mercurial-devel@mercurial-scm.org Delivered-To: mercurial-devel@mercurial-scm.org Received: from localhost (localhost [127.0.0.1]) by mercurial-scm.org (Postfix) with ESMTP id D5AEE2C211 for <mercurial-devel@mercurial-scm.org>; Sun, 3 Sep 2017 10:36:42 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at mercurial-scm.org Received: from mercurial-scm.org ([127.0.0.1]) by localhost (mercurial-scm.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xecVyayZSmzn for <mercurial-devel@mercurial-scm.org>; Sun, 3 Sep 2017 10:36:42 -0400 (EDT) Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::234]) by mercurial-scm.org (Postfix) with ESMTPS id D6B602C297 for <mercurial-devel@mercurial-scm.org>; Sun, 3 Sep 2017 10:36:40 -0400 (EDT) Received: by mail-pg0-x234.google.com with SMTP id r133so12332612pgr.3 for <mercurial-devel@mercurial-scm.org>; Sun, 03 Sep 2017 07:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:mime-version:content-transfer-encoding:subject:message-id :in-reply-to:references:user-agent:date:from:to; bh=AGDQPqeha/yNLBzR84bpZFarcYDweKMDXAJrgQvpOlU=; b=IzZnKRfje/K6avJg++0D4GnyQo9EJDD/+SRSVoBSl74Az08O10itX+5x2HD5Ae9I/O TTvzEAt9CYMGdSxrudki3v2kZ3gYLIpeWn7JK1r+dXvviA0y4r2hvqMt4Cy/5qScGrm9 Y/aemT6ajlKVcD3CUa504HS2J08rrsrisO/PmroQ6zr/F7Zc8/TkTCsErRY5bN6pPku9 ts+jWrvKs/g1+5dMTDOdeYNJxdoAlps6Y3FcuwccEETWQtE8lu4nKHwfmyc6bjDaV0s4 EbbmCauABV7wqsQRLJHZY6spuuYS7rgAhpeG0O2SIgfYdMHijviFLnCFRBqtVJdzjtyJ LbJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:mime-version:content-transfer-encoding :subject:message-id:in-reply-to:references:user-agent:date:from:to; bh=AGDQPqeha/yNLBzR84bpZFarcYDweKMDXAJrgQvpOlU=; b=P++04wMn4oNyaTchJFFJCqmQJ4LAo8VPXgQZ6nJBaIAZTzdNIwmL99irF9trYr69ik 6zCwKB28YgZXShDuvTf2aYbF5NiBJZmT9xF2s38568KHrBSdNb/oaO8IwZ4VAnvDuFZZ rQrPhZ/Co1CQ7li9DqB9lmbPYjSKBUV2/CpIGPeIP1lqWQ7ue/l0wxYZVWTevFgTuZbH xznY9rdnKHtekhHJ89DSI37qEljqSoEDE0ZP1/g90+ld6XbwkYcUkcPrKsx3KD3HCq+g BXnKBX0es30B3v4lsDZaqXY2gJZ4dWJPV25jKuzdxiZuwhBUA0hTNnP/qeLGqBLSxlfq jThw== X-Gm-Message-State: AHPjjUgYiYjF7wNjxXJRxaK7mAFwTpd5Ji1sPCzELs8cvA1GzEvYR2TX OBb1jom4eqcVpSBaKEk= X-Google-Smtp-Source: ADKCNb5jAaNgjCT8BrDWrGy/rPocs/f02km89tVPrhMUM6GQITRYPKoj00MCx5VVCxPalOtQWaHqeg== X-Received: by 10.99.173.73 with SMTP id y9mr8744014pgo.55.1504449400102; Sun, 03 Sep 2017 07:36:40 -0700 (PDT) Received: from [127.0.1.1] (p6e42bc73.tkyea126.ap.so-net.ne.jp. [110.66.188.115]) by smtp.gmail.com with ESMTPSA id m3sm7260990pgd.60.2017.09.03.07.36.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Sep 2017 07:36:39 -0700 (PDT) MIME-Version: 1.0 Subject: [PATCH 6 of 8] py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate() X-Mercurial-Node: 6f837717bec80a273aa7263d1d2af0f68ff04237 X-Mercurial-Series-Index: 6 X-Mercurial-Series-Total: 8 Message-Id: <6f837717bec80a273aa7.1504449384@mimosa> X-Mercurial-Series-Id: <313ecdde1470bb3a0e1f.1504449379@mimosa> In-Reply-To: <313ecdde1470bb3a0e1f.1504449379@mimosa> References: <313ecdde1470bb3a0e1f.1504449379@mimosa> User-Agent: Mercurial-patchbomb/4.3.1+368-b2eb0aa445cb Date: Sun, 03 Sep 2017 23:36:24 +0900 From: Yuya Nishihara <yuya@tcha.org> To: mercurial-devel@mercurial-scm.org X-BeenThere: mercurial-devel@mercurial-scm.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <mercurial-devel.mercurial-scm.org> List-Unsubscribe: <https://www.mercurial-scm.org/mailman/options/mercurial-devel>, <mailto:mercurial-devel-request@mercurial-scm.org?subject=unsubscribe> List-Archive: <http://www.mercurial-scm.org/pipermail/mercurial-devel/> List-Post: <mailto:mercurial-devel@mercurial-scm.org> List-Help: <mailto:mercurial-devel-request@mercurial-scm.org?subject=help> List-Subscribe: <https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel>, <mailto:mercurial-devel-request@mercurial-scm.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: mercurial-devel-bounces@mercurial-scm.org Sender: "Mercurial-devel" <mercurial-devel-bounces@mercurial-scm.org> |
Comments
Yuya Nishihara - Sept. 3, 2017, 2:36 p.m.
Patch
diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -169,7 +169,7 @@ def _parsetemplate(tmpl, start, stop, qu parsed.append(('string', parser.unescapestr(tmpl[pos:stop]))) pos = stop break - c = tmpl[n] + c = tmpl[n:n + 1] bs = (n - pos) - len(tmpl[pos:n].rstrip('\\')) if bs % 2 == 1: # escaped (e.g. '\{', '\\\{', but not '\\{')