[PATCH] subrepo: adapt to git's recent renames-by-default

Augie Fackler raf at durin42.com
Thu Mar 24 16:10:22 EDT 2016


On Thu, Mar 24, 2016 at 09:52:31AM -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> Perhaps this should be for stable? I don't use subrepos, but it
> doesn't doesn't seem essential to me that the diff is reported either
> including the renames or not. I don't know if subrepo users would
> care. But at least it would make tests pass on the stable branch even
> with more recent git versions.

Feels appropriate for stable to me. Queued for stable.

>
> On Thu, Mar 24, 2016 at 9:45 AM, Martin von Zweigbergk
> <martinvonz at google.com> wrote:
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz at google.com>
> > # Date 1458837491 25200
> > #      Thu Mar 24 09:38:11 2016 -0700
> > # Node ID dfaf62f028b6a496e3d49cc8082100b8c8c2dcc3
> > # Parent  1a1e4350b560cf2f49fe235d2e5168471877462d
> > 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).
> >
> > diff -r 1a1e4350b560 -r dfaf62f028b6 mercurial/subrepo.py
> > --- a/mercurial/subrepo.py      Thu Mar 24 00:09:58 2016 -0700
> > +++ b/mercurial/subrepo.py      Thu Mar 24 09:38:11 2016 -0700
> > @@ -1812,9 +1812,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')
> > @@ -1873,7 +1873,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:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list