Patchwork [3,of,3] webcommands: use fctx.isbinary

login
register
mail settings
Submitter Jun Wu
Date May 4, 2017, 1:19 a.m.
Message ID <6631c8d7398d3bab3135.1493860776@x1c>
Download mbox | patch
Permalink /patch/20411/
State Accepted
Headers show

Comments

Jun Wu - May 4, 2017, 1:19 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1493859883 25200
#      Wed May 03 18:04:43 2017 -0700
# Node ID 6631c8d7398d3bab3135b116ad9fe5072804a501
# Parent  5b6943b0ce441e9ce17c45090730304bec944bd4
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 6631c8d7398d
webcommands: use fctx.isbinary

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -809,5 +809,5 @@  def comparison(web, req, tmpl):
 
     def filelines(f):
-        if util.binary(f.data()):
+        if f.isbinary():
             mt = mimetypes.guess_type(f.path())[0]
             if not mt:
@@ -887,5 +887,5 @@  def annotate(web, req, tmpl):
 
     def annotate(**map):
-        if util.binary(fctx.data()):
+        if fctx.isbinary():
             mt = (mimetypes.guess_type(fctx.path())[0]
                   or 'application/octet-stream')