aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-03-06 22:08:21 +0000
committerStefan Monnier2008-03-06 22:08:21 +0000
commitb0a08954d512d8e70fdf3b49b7db281a98221c0a (patch)
tree8b7261ae47e7980b27c2a79396a9814462abce78
parentd530654e688b202fc326a9d0a8d9264731a25cae (diff)
downloademacs-b0a08954d512d8e70fdf3b49b7db281a98221c0a.tar.gz
emacs-b0a08954d512d8e70fdf3b49b7db281a98221c0a.zip
(vc-bzr-resolve-when-done, vc-bzr-find-file-hook): New functions.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/vc-bzr.el27
2 files changed, 30 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9dd876afbfa..b415c11303b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12008-03-06 Stefan Monnier <monnier@iro.umontreal.ca> 12008-03-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * vc-bzr.el (vc-bzr-resolve-when-done, vc-bzr-find-file-hook):
4 New functions.
5
3 * info.el (Info-bookmark-make-cell): Don't use the info-node argument. 6 * info.el (Info-bookmark-make-cell): Don't use the info-node argument.
4 7
52008-03-06 Lennart Borgman <lennart.borgman@gmail.com> (tiny change) 82008-03-06 Lennart Borgman <lennart.borgman@gmail.com> (tiny change)
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index e0ce72dd31f..e126296d779 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -232,6 +232,33 @@ If any error occurred in running `bzr status', then return nil."
232 (unknown . nil) 232 (unknown . nil)
233 (unchanged . up-to-date))))))) 233 (unchanged . up-to-date)))))))
234 234
235(defun vc-bzr-resolve-when-done ()
236 "Call \"bzr resolve\" if the conflict markers have been removed."
237 (save-excursion
238 (goto-char (point-min))
239 (unless (re-search-forward "^<<<<<<< " nil t)
240 (vc-bzr-command "resolve" nil 0 buffer-file-name)
241 ;; Remove the hook so that it is not called multiple times.
242 (remove-hook 'after-save-hook 'vc-bzr-resolve-when-done t))))
243
244(defun vc-bzr-find-file-hook ()
245 (when (and buffer-file-name
246 ;; FIXME: We should check that "bzr status" says "conflict".
247 (file-exists-p (concat buffer-file-name ".BASE"))
248 (file-exists-p (concat buffer-file-name ".OTHER"))
249 (file-exists-p (concat buffer-file-name ".THIS"))
250 ;; If "bzr status" says there's a conflict but there are no
251 ;; conflict markers, it's not clear what we should do.
252 (save-excursion
253 (goto-char (point-min))
254 (re-search-forward "^<<<<<<< " nil t)))
255 ;; TODO: the merge algorithm used in `bzr merge' is nicely configurable,
256 ;; but the one in `bzr pull' isn't, so it would be good to provide an
257 ;; elisp function to remerge from the .BASE/OTHER/THIS files.
258 (smerge-start-session)
259 (add-hook 'after-save-hook 'vc-bzr-resolve-when-done nil t)
260 (message "There are unresolved conflicts in this file")))
261
235(defun vc-bzr-workfile-unchanged-p (file) 262(defun vc-bzr-workfile-unchanged-p (file)
236 (eq 'unchanged (car (vc-bzr-status file)))) 263 (eq 'unchanged (car (vc-bzr-status file))))
237 264