From 54648b5c23a37346e89c99e622bc81e7a5f30d3f Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 15 Jan 2008 04:37:20 +0000 Subject: [PATCH] * vc-arch.el (vc-arch-delete-rej-if-obsolete): Remove the after-save-hook so that it is not called multiple times. * vc-svn.el (vc-svn-resolve-when-done): Likewise. --- lisp/ChangeLog | 7 +++++++ lisp/vc-arch.el | 8 +++++--- lisp/vc-svn.el | 6 ++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 91d3a778f24..0ec33846981 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2008-01-15 Dan Nicolaescu + + * vc-arch.el (vc-arch-delete-rej-if-obsolete): Remove the + after-save-hook so that it is not called multiple times. + + * vc-svn.el (vc-svn-resolve-when-done): Likewise. + 2008-01-15 Glenn Morris * diff-mode.el (diff-end-of-hunk): Revert 2008-01-08 change. diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el index 137dcf9e20f..c027d981b3a 100644 --- a/lisp/vc-arch.el +++ b/lisp/vc-arch.el @@ -341,9 +341,11 @@ Return non-nil if FILE is unchanged." (save-excursion (let ((rej (concat buffer-file-name ".rej"))) (when (and buffer-file-name (vc-arch-diff3-rej-p rej)) - (if (not (re-search-forward "^<<<<<<< " nil t)) - ;; The .rej file is obsolete. - (condition-case nil (delete-file rej) (error nil))))))) + (unless (re-search-forward "^<<<<<<< " nil t) + ;; The .rej file is obsolete. + (condition-case nil (delete-file rej) (error nil)) + ;; Remove the hook so that it is not called multiple times. + (remove-hook 'after-save-hook 'vc-arch-delete-rej-if-obsolete t)))))) (defun vc-arch-find-file-hook () (let ((rej (concat buffer-file-name ".rej"))) diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 3e67a89afc7..0b0dd1ed74c 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el @@ -497,8 +497,10 @@ and that it passes `vc-svn-global-switches' to it before FLAGS." "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")))) + (unless (re-search-forward "^<<<<<<< " nil t) + (vc-svn-command nil 0 buffer-file-name "resolved") + ;; Remove the hook so that it is not called multiple times. + (remove-hook 'after-save-hook 'vc-svn-resolve-when-done t)))) ;; Inspired by vc-arch-find-file-hook. (defun vc-svn-find-file-hook () -- 2.39.2