aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-01-14 07:38:05 +0000
committerDan Nicolaescu2008-01-14 07:38:05 +0000
commitba463d9eca5f05817eb843372ebc9e46ecbb471f (patch)
treebc0b28bf00715380c7a0ea0d59e1bcbc6a1e1e48
parent944df51178e5c6617e89d28a2e6797b02550fde0 (diff)
downloademacs-ba463d9eca5f05817eb843372ebc9e46ecbb471f.tar.gz
emacs-ba463d9eca5f05817eb843372ebc9e46ecbb471f.zip
* smerge-mode.el (smerge-auto): New function.
* vc-svn.el (vc-svn-find-file-hook): * vc-arch.el (vc-arch-find-file-hook): * pcvs.el (cvs-revert-if-needed): * vc.el (vc-maybe-resolve-conflicts): Use it instead of vc-mode. (top-level): Add a Todo list.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/pcvs.el2
-rw-r--r--lisp/smerge-mode.el8
-rw-r--r--lisp/vc-arch.el2
-rw-r--r--lisp/vc-svn.el2
-rw-r--r--lisp/vc.el29
6 files changed, 46 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3e9da0593db..7c63ad22bef 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12008-01-14 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * smerge-mode.el (smerge-auto): New function.
4 * vc-svn.el (vc-svn-find-file-hook):
5 * vc-arch.el (vc-arch-find-file-hook):
6 * pcvs.el (cvs-revert-if-needed):
7 * vc.el (vc-maybe-resolve-conflicts): Use it instead of vc-mode.
8 (top-level): Add a Todo list.
9
12008-01-13 Dan Nicolaescu <dann@ics.uci.edu> 102008-01-13 Dan Nicolaescu <dann@ics.uci.edu>
2 11
3 * vc.el (vc-update): Resolve conflicts if necessary instead of 12 * vc.el (vc-update): Resolve conflicts if necessary instead of
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index c4a7f67d930..401962872a2 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -2311,7 +2311,7 @@ this file, or a list of arguments to send to the program."
2311 ;; do want to reset the mode for VC, so we do it explicitly. 2311 ;; do want to reset the mode for VC, so we do it explicitly.
2312 (vc-find-file-hook) 2312 (vc-find-file-hook)
2313 (when (eq (cvs-fileinfo->type fileinfo) 'CONFLICT) 2313 (when (eq (cvs-fileinfo->type fileinfo) 'CONFLICT)
2314 (smerge-mode 1)))))))) 2314 (smerge-auto))))))))
2315 2315
2316 2316
2317(defun cvs-change-cvsroot (newroot) 2317(defun cvs-change-cvsroot (newroot)
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index b72107eb6c3..fe7d06e537b 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -1021,6 +1021,14 @@ buffer names."
1021 (unless smerge-mode 1021 (unless smerge-mode
1022 (smerge-remove-props (point-min) (point-max)))) 1022 (smerge-remove-props (point-min) (point-max))))
1023 1023
1024;;;###autoload
1025(defun smerge-auto ()
1026 "Turn on `smerge-mode' and move point to first conflict marker.
1027If no conflict maker is found, turn off `smerge-mode'."
1028 (smerge-mode 1)
1029 (condition-case nil
1030 (smerge-next)
1031 (error (smerge-auto-leave))))
1024 1032
1025(provide 'smerge-mode) 1033(provide 'smerge-mode)
1026 1034
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index 284fe032a25..97c99dd8193 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -360,7 +360,7 @@ Return non-nil if FILE is unchanged."
360 (if (not (re-search-forward "^<<<<<<< " nil t)) 360 (if (not (re-search-forward "^<<<<<<< " nil t))
361 ;; The .rej file is obsolete. 361 ;; The .rej file is obsolete.
362 (condition-case nil (delete-file rej) (error nil)) 362 (condition-case nil (delete-file rej) (error nil))
363 (smerge-mode 1) 363 (smerge-auto)
364 (add-hook 'after-save-hook 364 (add-hook 'after-save-hook
365 'vc-arch-delete-rej-if-obsolete nil t) 365 'vc-arch-delete-rej-if-obsolete nil t)
366 (message "There are unresolved conflicts in this file"))) 366 (message "There are unresolved conflicts in this file")))
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index e387b57d4fe..16e10edc202 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -551,7 +551,7 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
551 (re-search-forward "^<<<<<<< " nil t)) 551 (re-search-forward "^<<<<<<< " nil t))
552 ;; There are conflict markers. 552 ;; There are conflict markers.
553 (progn 553 (progn
554 (smerge-mode 1) 554 (smerge-auto)
555 (add-hook 'after-save-hook 'vc-svn-resolve-when-done nil t)) 555 (add-hook 'after-save-hook 'vc-svn-resolve-when-done nil t))
556 ;; There are no conflict markers. This is problematic: maybe it means 556 ;; There are no conflict markers. This is problematic: maybe it means
557 ;; the conflict has been resolved and we should immediately call "svn 557 ;; the conflict has been resolved and we should immediately call "svn
diff --git a/lisp/vc.el b/lisp/vc.el
index 5006af37ec5..cc2627bb792 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -7,8 +7,6 @@
7;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8;; Keywords: tools 8;; Keywords: tools
9 9
10;; $Id$
11
12;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
13 11
14;; GNU Emacs is free software; you can redistribute it and/or modify 12;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -522,6 +520,31 @@
522;; to your backend and which does not map to any of the VC generic 520;; to your backend and which does not map to any of the VC generic
523;; concepts. 521;; concepts.
524 522
523;;; Todo:
524
525;; - Make vc-checkin avoid reverting the buffer if has not changed
526;; after the checkin. Comparing (md5 BUFFER) to (md5 FILE) should
527;; be enough.
528;;
529;; - vc-update/vc-merge should deal with VC systems that don't
530;; update/merge on a file basis, but on a whole repository basis.
531;;
532;; - vc-register should register multiple files at a time. The
533;; `register' backend function already supports that.
534;;
535;; - the *VC-log* buffer needs font-locking.
536;;
537;; - make it easier to write logs, maybe C-x 4 a should add to the log
538;; buffer if there's one instead of the ChangeLog.
539;;
540;; - deal with push/pull operations.
541;;
542;; - decide if vc-status should replace vc-dired.
543;;
544;; - vc-status should be made asynchronous.
545;;
546;; - vc-status needs a menu, mouse bindings and some color bling.
547
525;;; Code: 548;;; Code:
526 549
527(require 'vc-hooks) 550(require 'vc-hooks)
@@ -2222,7 +2245,7 @@ See Info node `Merging'."
2222(defun vc-maybe-resolve-conflicts (file status &optional name-A name-B) 2245(defun vc-maybe-resolve-conflicts (file status &optional name-A name-B)
2223 (vc-resynch-buffer file t (not (buffer-modified-p))) 2246 (vc-resynch-buffer file t (not (buffer-modified-p)))
2224 (if (zerop status) (message "Merge successful") 2247 (if (zerop status) (message "Merge successful")
2225 (smerge-mode 1) 2248 (smerge-auto)
2226 (message "File contains conflicts."))) 2249 (message "File contains conflicts.")))
2227 2250
2228;;;###autoload 2251;;;###autoload