diff options
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 18 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7bb7415bc9c..764d6d12c8a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-08-13 Eric S. Raymond <esr@thyrsus.com> | ||
| 2 | |||
| 3 | * vc/vc-git.el (vc-git-conflicted-files): Integrate RĂ¼diger | ||
| 4 | Sonderfeld's code for detecting conflicted files using a status | ||
| 5 | listing. Useful in itself and a step towards better smerge | ||
| 6 | support. | ||
| 7 | |||
| 1 | 2014-08-12 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2014-08-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * mpc.el (mpc-reorder): Don't bother splitting the "active"s elements | 10 | * mpc.el (mpc-reorder): Don't bother splitting the "active"s elements |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 9c8ab3ba393..3e9228601d8 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -102,6 +102,7 @@ | |||
| 102 | ;; - delete-file (file) OK | 102 | ;; - delete-file (file) OK |
| 103 | ;; - rename-file (old new) OK | 103 | ;; - rename-file (old new) OK |
| 104 | ;; - find-file-hook () NOT NEEDED | 104 | ;; - find-file-hook () NOT NEEDED |
| 105 | ;; - conflicted-files OK | ||
| 105 | 106 | ||
| 106 | ;;; Code: | 107 | ;;; Code: |
| 107 | 108 | ||
| @@ -769,6 +770,23 @@ This prompts for a branch to merge from." | |||
| 769 | (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) | 770 | (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) |
| 770 | (vc-set-async-update buffer))) | 771 | (vc-set-async-update buffer))) |
| 771 | 772 | ||
| 773 | (defun vc-git-conflicted-files (directory) | ||
| 774 | "Return the list of files with conflicts in DIRECTORY." | ||
| 775 | (let* ((status | ||
| 776 | (vc-git--run-command-string directory "status" "--porcelain" "--")) | ||
| 777 | (lines (split-string status "\n" 'omit-nulls)) | ||
| 778 | files) | ||
| 779 | (dolist (line lines files) | ||
| 780 | (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" | ||
| 781 | line) | ||
| 782 | (let ((state (match-string 1 line)) | ||
| 783 | (file (match-string 2 line))) | ||
| 784 | ;; See git-status(1). | ||
| 785 | (when (member state '("AU" "UD" "UA" ;; "DD" | ||
| 786 | "DU" "AA" "UU")) | ||
| 787 | (push file files))))))) | ||
| 788 | |||
| 789 | |||
| 772 | ;;; HISTORY FUNCTIONS | 790 | ;;; HISTORY FUNCTIONS |
| 773 | 791 | ||
| 774 | (autoload 'vc-setup-buffer "vc-dispatcher") | 792 | (autoload 'vc-setup-buffer "vc-dispatcher") |