D6183: copies: add config option for writing copy metadata to file and/or changset

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Apr 13 12:32:36 EDT 2019


martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6183#90698, @yuja wrote:
  
  > > +def encodecopies(copies):
  > >  +    items = [
  > >  +        '%s\0%s' % (_string_escape(k), _string_escape(copies[k]))
  > >  +        for k in sorted(copies)
  > >  +    ]
  > >  +    return "\n".join(items)
  >
  > It might be nitpicky, but I think it's better to not embed `\0` into the
  >  extras field. Almost all extras data are texts, and IIRC we regret that
  >  transplant sources are stored in binary form.
  
  
  Why not? I picked \0 and \n because they won't appear in filenames, so it's convenient in that way.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: yuja, pulkit, gracinet, marmoute, mercurial-devel


More information about the Mercurial-devel mailing list