+2011-02-03 Glenn Morris <rgm@gnu.org>
+
+ * bzrmerge.el (bzrmerge-buffer): New constant.
+ (bzrmerge-merges, bzrmerge-missing, bzrmerge-apply): Use it.
+ (bzrmerge-missing): If nothing to do, return nil not (nil).
+ (bzrmerge-apply): Remove odd character from message.
+ (bzrmerge): Give status messages.
+
2011-01-31 Eli Zaretskii <eliz@gnu.org>
- * admin.el (set-version): Remove lib-src/makefile.w32-in. Add
- nt/config.nt.
+ * admin.el (set-version): Remove lib-src/makefile.w32-in.
+ Add nt/config.nt.
2011-01-31 Paul Eggert <eggert@cs.ucla.edu>
-;;; bzrmerge.el ---
+;;; bzrmerge.el --- help merge one Emacs bzr branch to another
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
;;; Commentary:
-;;
+;; Some usage notes are in admin/notes/bzr.
;;; Code:
"Regexp matching logs of revisions that might be skipped.
`bzrmerge-missing' will ask you if it should skip any matches.")
+(defconst bzrmerge-buffer "*bzrmerge*"
+ "Working buffer for bzrmerge.")
+
(defun bzrmerge-merges ()
"Return the list of already merged (not yet committed) revisions.
The list returned is sorted by oldest-first."
- (with-current-buffer (get-buffer-create "*bzrmerge*")
+ (with-current-buffer (get-buffer-create bzrmerge-buffer)
(erase-buffer)
;; We generally want to make sure we start with a clean tree, but we also
;; want to allow restarts (i.e. with some part of FROM already merged but
Asks about skipping revisions with logs matching `bzrmerge-skip-regexp'.
The result is of the form (TOMERGE . TOSKIP) where TOMERGE and TOSKIP
are both lists of revnos, in oldest-first order."
- (with-current-buffer (get-buffer-create "*bzrmerge*")
+ (with-current-buffer (get-buffer-create bzrmerge-buffer)
(erase-buffer)
(call-process "bzr" nil t nil "missing" "--theirs-only"
(expand-file-name from))
(push revno skipped)
(push revno revnos)))))
(delete-region (point) (point-max)))
- (cons (nreverse revnos) (nreverse skipped)))))
+ (and (or revnos skipped)
+ (cons (nreverse revnos) (nreverse skipped))))))
(defun bzrmerge-resolve (file)
(unless (file-exists-p file) (error "Bzrmerge-resolve: Can't find %s" file))
(defun bzrmerge-apply (missing from)
(setq from (expand-file-name from))
- (with-current-buffer (get-buffer-create "*bzrmerge*")
+ (with-current-buffer (get-buffer-create bzrmerge-buffer)
(erase-buffer)
(when (equal (cdr bzrmerge-already-done) (list from missing))
(setq missing (car bzrmerge-already-done)))
;; bzrmerge-add-metadata does not work when there
;; are conflicts.
(display-warning 'bzrmerge "Resolve conflicts manually.
-¡BEWARE! Important metadata is kept in this Emacs session!
+¡BEWARE! Important metadata is kept in this Emacs session!
Do not commit without re-running `M-x bzrmerge' first!"))
(error "Resolve conflicts manually")))))
(cons merge skip)))))
(let* ((merges (bzrmerge-merges))
;; OK, we have the status, now check the missing data.
(missing (bzrmerge-missing from merges)))
- (while missing
- (setq missing (bzrmerge-apply missing from))))))
+ (if (not missing)
+ (message "Merging from %s...nothing to merge" from)
+ (while missing
+ (setq missing (bzrmerge-apply missing from)))
+ (message "Merging from %s...done" from)))))
(provide 'bzrmerge)
;;; bzrmerge.el ends here