spectral added a comment.

  In D8281#124129 <https://phab.mercurial-scm.org/D8281#124129>, @durin42 wrote:
  
  > In D8281#124058 <https://phab.mercurial-scm.org/D8281#124058>, @marmoute 
wrote:
  >
  >> Since narrow is still experimental, I don't think we should try too hard 
for backward compatibility. We could introduce a new end-point for a new 
encoding and drop the old one in a couple of version.
  >
  > +0, honestly. I won't require it, but I'd really rather we shaved this yak 
_now_ rather than when narrow has even more users.
  
  I'm getting a bit frustrated with how much time I've spent on this, made 
worse by the fact that I agree with everything everyone's saying and so it's 
not like I'm frustrated at the review process, just how slow I've been at 
accomplishing this.
  
  So, before I go down another rabbit hole, here's what I'm thinking:
  
  - Server emits a new capability `narrow-exp-1-escaped` (in addition to the 
current `narrow-exp-1`, this is not replacing the existing capability)
  - wireprototypes's map will change these items from csv to csv.escaped
  - Compatible clients will detect this capability from the server and send 
items of type csv.escaped during getbundle with keys like 
`<previousname>.escaped` (ex: `include.escaped`). If the server doesn't support 
csv.escaped, the client sends with the old names (unescaped).
  - The escaping will be urllibcompat.quote
  - The server will strip the `.escaped` suffix on the keys, split on comma, 
and urllibcompat.unquote the individual items
  - I'm *not* expecting to do anything about `\` -> `/` conversion.
  
  Since these are part of `getbundle`, I haven't found a way of doing this 
that's not one of:
  
  - a custom escaping mechanism that's backwards compatible
  - adding a capability and renaming the keys that are sent (so the server can 
tell when it needs to unescape)
  - having the client always send duplicate items (i.e. send `include` and 
`include.escaped`). I'm not even sure that older servers would tolerate 
receiving keys they aren't expecting.
  - having the client only escape when necessary (i.e. it includes a comma), 
and then always send the path as include.escaped (which runs into the problem 
of old servers rejecting).
  - having the server always unescape and the client always escape. This breaks 
the server's ability to interact with older clients that aren't escaping (which 
we'll need to support for at least a week or two).
  
  For the non-getbundle parts (I think the wireproto command is 'widen'), we 
can easily make a widen2 or something, but it's probably easier to just keep 
the same command name and do the same thing as in getbundle: detect the 
capability, send as foo.escaped if supported.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8281/new/

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

To: spectral, durin42, martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mharbison72, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to