* automated/vc-tests.el (vc-test--revision-granularity-function):
New defun.
(vc-test--create-repo-function): Rename from
`vc-test--create-repo-if-not-supported'.  Adapt all callees.
(vc-test--create-repo): Check also for revision-granularity.
(vc-test--unregister-function): Additional argument FILE.  Adapt
all callees.
(vc-test--working-revision): New defun.
(vc-test-*-working-revision): New tests.
Never pass an invalid X connection descriptor to an input reading loop

Fixes: debbugs:19147

* xterm.c (x_delete_terminal): Call emacs_close for X connection
descriptor if called from x_connection_closed and always delete
this descriptor from keyboard waiting set (Bug#19147).