D6168: readline: provide styled prompt to readline (issue6070)

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Fri Mar 22 15:40:39 EDT 2019


spectral added a comment.


  In https://phab.mercurial-scm.org/D6168#89876, @martinvonz wrote:
  
  > Except that `test-command-server.t` fails like this:
  >
  >   @@ -776,11 +776,9 @@
  >      message: '\xa3DdataJpassword: Hpassword\xf5DtypeFprompt'
  >      1234
  >      *** runcommand debugprompt --config ui.interactive=True
  >   -  message: '\xa3DdataGprompt:GdefaultAyDtypeFprompt'
  >   -   5678
  >   +  prompt: 5678
  >      *** runcommand debugpromptchoice --config ui.interactive=True
  >   -  message: '\xa4Gchoices\x82\x82AyCYes\x82AnBNoDdataTpromptchoice (y/n)? GdefaultAyDtypeFprompt'
  >   -   1
  >   +  promptchoice (y/n)?  1
  >  
  >    bad message encoding:
  >
  >
  > @spectral, any idea how to fix?
  
  
  Oh, right... I saw that and that was part of why I didn't mail earlier :D  I think this is just an "expected" difference in behavior, but I don't know enough about what this test was doing or why it was verifying the chg "wireprotocol" to know for sure if this was highlighting a problem or just brittleness.  As far as I can tell, this is just the way that '_writemsgnobuf' works in the command server: it encodes everything passed to it (args, kwargs, etc.) and throws it on the channel, letting the other side figure out what to do with it. Since we're using readline now, this doesn't get encoded like most chg messages.
  
  That said, I haven't been able to show this breaking anything, but perhaps I'm holding it wrong? In terminal window 1, I ran HG=<hg_I_just_built> chg debuguiprompt -p 'are kittens cute?', resized the window, everything was fine.  In terminal window 2, I did the same thing, but it started a second chg. I was hoping it'd use the same chg server so that I'd end up possibly reusing the same tty and causing an issue?
  
  We already have unencoded output in this test: the space and the default response, so that's clearly not breaking the protocol.
  
  tl;dr: I *think* this is fine/expected to just update the test with this new output, but we might want yuya to verify.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers, jeffpc
Cc: martinvonz, jeffpc, spectral, mercurial-devel


More information about the Mercurial-devel mailing list