Patchwork [1,of,7] mq: treat all files as text in Git mode

login
register
mail settings
Submitter Alexander Fomin
Date March 21, 2017, 5:08 p.m.
Message ID <3c43572fec91b9caa83d.1490116114@devvm2125.lla2.facebook.com>
Download mbox | patch
Permalink /patch/19528/
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 1490051288 25200
#      Mon Mar 20 16:08:08 2017 -0700
# Node ID 3c43572fec91b9caa83dc3402532046013b84e07
# Parent  65969cd351b73228642d1e491e8c78b20d85405a
mq: treat all files as text in Git mode

This patch makes mq treat all files as text when in Git mode.
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/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1180,6 +1180,8 @@  class queue(object):
         if date:
             date = util.parsedate(date)
         diffopts = self.diffopts({'git': opts.get('git')})
+        if diffopts.git:
+            diffopts.text = True
         if opts.get('checkname', True):
             self.checkpatchname(patchfn)
         inclsubs = checksubstate(repo)
@@ -2609,6 +2611,8 @@  def new(ui, repo, patch, *args, **opts):
     msg = cmdutil.logmessage(ui, opts)
     q = repo.mq
     opts['msg'] = msg
+    if opts['git']:
+        opts['text'] = True
     setupheaderopts(ui, opts)
     q.new(repo, patch, *args, **opts)
     q.savedirty()