[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v |
Date: |
Tue, 09 Oct 2007 08:53:03 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Miles Bader <miles> 07/10/09 08:52:58
Index: lisp/vc-svn.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-svn.el,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- lisp/vc-svn.el 3 Sep 2007 06:25:50 -0000 1.43
+++ lisp/vc-svn.el 9 Oct 2007 08:52:45 -0000 1.44
@@ -521,6 +521,33 @@
;; behavior for different modules on the same server.
(match-string 1))))
+(defun vc-svn-resolve-when-done ()
+ "Call \"svn resolved\" if the conflict markers have been removed."
+ (save-excursion
+ (goto-char (point-min))
+ (if (not (re-search-forward "^<<<<<<< " nil t))
+ (vc-svn-command nil 0 buffer-file-name "resolved"))))
+
+;; Inspired by vc-arch-find-file-hook.
+(defun vc-svn-find-file-hook ()
+ (when (eq ?C (vc-file-getprop buffer-file-name 'vc-svn-status))
+ ;; If the file is marked as "conflicted", then we should try and call
+ ;; "svn resolved" when applicable.
+ (if (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "^<<<<<<< " nil t))
+ ;; There are conflict markers.
+ (progn
+ (smerge-mode 1)
+ (add-hook 'after-save-hook 'vc-svn-resolve-when-done nil t))
+ ;; There are no conflict markers. This is problematic: maybe it means
+ ;; the conflict has been resolved and we should immediately call "svn
+ ;; resolved", or it means that the file's type does not allow Svn to
+ ;; use conflict markers in which case we don't really know what to do.
+ ;; So let's just punt for now.
+ nil)
+ (message "There are unresolved conflicts in this file")))
+
(defun vc-svn-parse-status (&optional filename)
"Parse output of \"svn status\" command in the current buffer.
Set file properties accordingly. Unless FILENAME is non-nil, parse only
@@ -543,6 +570,8 @@
;; Use the last-modified revision, so that searching in vc-print-log
;; output works.
(vc-file-setprop file 'vc-workfile-version (match-string 3))
+ ;; Remember Svn's own status.
+ (vc-file-setprop file 'vc-svn-status status)
(vc-file-setprop
file 'vc-state
(cond
- [Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v,
Miles Bader <=
- [Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v, Eric S. Raymond, 2007/10/09
- [Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v, Eric S. Raymond, 2007/10/10
- [Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v, Eric S. Raymond, 2007/10/10
- [Emacs-diffs] Changes to emacs/lisp/vc-svn.el,v, Stefan Monnier, 2007/10/19