[PATCH 3 of 7] cmdutil: treat all files as text when doing a record

Alexander Fomin afomin at fb.com
Tue Mar 21 13:08:36 EDT 2017


# HG changeset patch
# User Alexander Fomin <afomin at fb.com>
# Date 1490104984 25200
#      Tue Mar 21 07:03:04 2017 -0700
# Node ID a4b6c5df3e64195cb8ba124d9dd2428483cfc6a6
# Parent  6e4849bc2c126815e8edfe176257883907596361
cmdutil: treat all files as text when doing a record

This patch makes cmdutil treat all files as text when when doing a record.
It has no immediate effect, but rather allows to change hg behaviour with
regarding to binary diffs generation in Git mode (issue5510).

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -162,6 +162,8 @@ def dorecord(ui, repo, commitfunc, cmdsu
         diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True)
         diffopts.nodates = True
         diffopts.git = True
+        # Explicitly request binary diffs in Git mode
+        diffopts.text = True
         diffopts.showfunc = True
         originaldiff = patch.diff(repo, changes=status, opts=diffopts)
         originalchunks = patch.parsepatch(originaldiff)


More information about the Mercurial-devel mailing list