Refactor 'vc-default-mode-line-string' (bug#66464)

* lisp/vc/vc-hooks.el (vc-mode-line-state): New function with code moved from
'vc-default-mode-line-string'.
(vc-default-mode-line-string): Use 'vc-mode-line-state'.

* lisp/vc/vc-git.el (vc-git-mode-line-string): Use
'vc-mode-line-state' instead of hacking the string returned from
'vc-default-mode-line-string'.

* lisp/vc/vc-hg.el (vc-hg-mode-line-string): Use
'vc-mode-line-state' instead of duplicating code from
'vc-default-mode-line-string'.
1 job for master in 8 minutes and 10 seconds (queued for 17 seconds)
Status Job ID Name Coverage
  Normal
failed #75583
test-lisp-vc-inotify

00:08:10

 
Name Stage Failure
failed
test-lisp-vc-inotify Normal
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: test-lisp-vc-inotify-5827d179: No such file or directory
Uploading artifacts...
WARNING: test-lisp-vc-inotify-5827d179/: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: test-lisp-vc-inotify-5827d179/junit-test-report.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1