[MERGE] Shelf 5 / 5
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Oct 29 09:59:42 GMT 2008
>>>>> "aaron" == Aaron Bentley <aaron at aaronbentley.com> writes:
aaron> Vincent Ladeuil wrote:
>>>>>>> "aaron" == Aaron Bentley <aaron at aaronbentley.com> writes:
>> Eerk ! Am I right in inferring from the above that the input
>> handling will be character based ?
aaron> Yes. I don't remember anyone complaining about it before,
I think we briefly discussed it years ago and you said you
inherited the design (I fail to see who else can have said that
;-)
aaron> and I certainly prefer it that way.
Full agreement, it's perfect for most of the cases.
>> This implies that it can't be used under emacs where input is
>> line buffered (i.e. you can't read a character at a time, only a
>> '\n' terminated line).
aaron> I never meant for shelf to be run inside editors, but
aaron> I'm happy for it to work in editors.
aaron> Have you tested it and shown that it doesn't work
aaron> under Emacs?
Not your version, but just imagine that, when run under emacs,
shelf is fed with lines only and only when return is pressed by
the user.
It means the user should mentally prepare the workflow and type
all the characters before pressing return (blindly since the
prompts are not shown of course).
I quickly stopped using shelf once I understood the problem, I
looked into the code but things were so tight so I couldn't find
a solution.
I have better hopes with this version.
The fact that '\n' means 'use the default value' may complicate
things a bit though.
Re-reading a bit, I can't confirm that the above remark still has
legs nor the meaning of 'f' in [yNfq].
May be Shelver.auto needs a bit more documentation ?
I'll try to find time to test it but I'm not promising anything,
I thought at least the remarks could help.
As long as shelf was based on patch, I had a better solution
under emacs, now that shelf can handle renames and binary diffs
though, I have some incentives to come back :)
aaron> What steps would be necessary to detect Emacs and
aaron> change behavior?
Almost certainly $TERM == 'dumb'.
aaron> + def prompt(self, message):
aaron> + sys.stdout.write(message)
aaron> + char = osutils.getchar()
aaron> + sys.stdout.write("\r" + ' ' * len(message) + '\r')
aaron> + sys.stdout.flush()
aaron> + return char
>>
>> Or can this single method be overridden to address the issue ?
aaron> I isolated it here for testing reasons,
TDD helping design :)
aaron> but I'm happy to commit to always using this method.
That was the hope behind my remark, thanks.
Vincent
More information about the bazaar
mailing list