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

login
register
mail settings
Submitter Alexander Fomin
Date March 21, 2017, 5:08 p.m.
Message ID <a4b6c5df3e64195cb8ba.1490116116@devvm2125.lla2.facebook.com>
Download mbox | patch
Permalink /patch/19529/
State Changes Requested
Headers show

Comments

Alexander Fomin - March 21, 2017, 5:08 p.m.
# HG changeset patch
# User Alexander Fomin <afomin@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).

Patch

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)