changeset 28618:7dab4caf11bc stable

subrepo: adapt to git's recent renames-by-default Git turned on renames by default in commit 5404c11 (diff: activate diff.renames by default, 2016-02-25). The change is destined for release in git 2.8.0. The change breaks test-subrepo-git, which test specifically that a moved file is reported as a removal and an addition. Fix by passing --no-renames (available in git since mid 2006) to the diff commands that don't use --quiet (should make no difference for those).
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 24 Mar 2016 09:38:11 -0700
parents aa440c3d7c5d
children 345f4fa4cc89 a2c2dd399f3b
files mercurial/subrepo.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py	Sun Mar 13 02:29:11 2016 +0100
+++ b/mercurial/subrepo.py	Thu Mar 24 09:38:11 2016 -0700
@@ -1810,9 +1810,9 @@
         modified, added, removed = [], [], []
         self._gitupdatestat()
         if rev2:
-            command = ['diff-tree', '-r', rev1, rev2]
+            command = ['diff-tree', '--no-renames', '-r', rev1, rev2]
         else:
-            command = ['diff-index', rev1]
+            command = ['diff-index', '--no-renames', rev1]
         out = self._gitcommand(command)
         for line in out.split('\n'):
             tab = line.find('\t')
@@ -1871,7 +1871,7 @@
     @annotatesubrepoerror
     def diff(self, ui, diffopts, node2, match, prefix, **opts):
         node1 = self._state[1]
-        cmd = ['diff']
+        cmd = ['diff', '--no-renames']
         if opts['stat']:
             cmd.append('--stat')
         else: