[PATCH 3 of 3] webcommands: use fctx.isbinary

Jun Wu quark at fb.com
Wed May 3 21:19:36 EDT 2017


# HG changeset patch
# User Jun Wu <quark at 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

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')


More information about the Mercurial-devel mailing list