+2012-04-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ webkit-tools-completion: Support bugzilla email completion for webkit-patch upload --cc
+ https://bugs.webkit.org/show_bug.cgi?id=83690
+
+ Reviewed by Tor Arne Vestbø.
+
+ Typing part of an email and pressing <TAB> will bash-complete it using the list in
+ Tools/Scripts/webkitpy/common/config/committers.py
+
+ * Scripts/webkit-tools-completion.sh:
+
2012-04-13 Thiago Marcos P. Santos <thiago.santos@intel.com>
[EFL] Add API for color chooser
COMPREPLY=( $(compgen -W "$1" -- "${COMP_WORDS[COMP_CWORD]}") )
}
+__webkit-patch_upload_cc_generate_reply()
+{
+ # Completion is done on tokens and our comma-separated list is one single token, so we have to do completion on the whole list each time.
+ # Return a \n separated list for each possible bugzilla email completion of the substring following the last comma.
+ # Redirect strerr to /dev/null to prevent noise in the shell if this ever breaks somehow.
+ COMPREPLY=( $(PYTHONPATH=$(dirname "${BASH_SOURCE[0]}") python -c "
+import sys,re
+from webkitpy.common.config.committers import CommitterList
+m = re.match('((.*,)*)(.*)', sys.argv[1])
+untilLastComma = m.group(1)
+afterLastComma = m.group(3)
+print('\n'.join([untilLastComma + c.bugzilla_email() + ',' for c in CommitterList().contributors() if c.bugzilla_email().startswith(afterLastComma)]))" "${COMP_WORDS[COMP_CWORD]}" 2>/dev/null ) )
+}
+
_webkit-patch_complete()
{
local command current_command="${COMP_WORDS[1]}"
return
;;
upload)
+ if [[ ${COMP_WORDS[COMP_CWORD-1]} == "--cc" || ${COMP_WORDS[COMP_CWORD-1]} == "=" && ${COMP_WORDS[COMP_CWORD-2]} == "--cc" ]]; then
+ __webkit-patch_upload_cc_generate_reply
+ return
+ fi
__webkit-patch_generate_reply "--description --no-obsolete --no-review --request-commit --cc -m --open-bug"
return
;;