D5628: diffstat: make --git work properly on renames (issue6025)

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sat Jan 26 00:18:23 EST 2019


yuja added a comment.


  > @@ -2808,6 +2808,10 @@
  > 
  >   elif (line.startswith('GIT binary patch') or
  >         line.startswith('Binary file')):
  >       isbinary = True
  > 
  > +        elif line.startswith('rename from'):
  >  +            filename = line.split()[-1]
  >  +        elif line.startswith('rename to'):
  >  +            filename += ' => %s' % line.split()[-1]
  
  Nice.
  
  One nit: better to not use `.split()` since a filename may include whitespace.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5628

To: navaneeth.suresh, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list