aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-02-02 23:09:50 -0800
committerGlenn Morris2011-02-02 23:09:50 -0800
commitf6041baa9d84125b0af4939b2d05edc0c59f034a (patch)
treee5edd5191c78a130b0688377cb86fbd9c5c56ce6
parentfd7ec1ba35a61bd68d82704e9fe4c6b60513f83f (diff)
downloademacs-f6041baa9d84125b0af4939b2d05edc0c59f034a.tar.gz
emacs-f6041baa9d84125b0af4939b2d05edc0c59f034a.zip
bzrmerge.el trivia.
* admin/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.
-rw-r--r--admin/ChangeLog12
-rw-r--r--admin/bzrmerge.el25
2 files changed, 26 insertions, 11 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index f7d60b08e4c..46dbaa0da26 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,7 +1,15 @@
12011-02-03 Glenn Morris <rgm@gnu.org>
2
3 * bzrmerge.el (bzrmerge-buffer): New constant.
4 (bzrmerge-merges, bzrmerge-missing, bzrmerge-apply): Use it.
5 (bzrmerge-missing): If nothing to do, return nil not (nil).
6 (bzrmerge-apply): Remove odd character from message.
7 (bzrmerge): Give status messages.
8
12011-01-31 Eli Zaretskii <eliz@gnu.org> 92011-01-31 Eli Zaretskii <eliz@gnu.org>
2 10
3 * admin.el (set-version): Remove lib-src/makefile.w32-in. Add 11 * admin.el (set-version): Remove lib-src/makefile.w32-in.
4 nt/config.nt. 12 Add nt/config.nt.
5 13
62011-01-31 Paul Eggert <eggert@cs.ucla.edu> 142011-01-31 Paul Eggert <eggert@cs.ucla.edu>
7 15
diff --git a/admin/bzrmerge.el b/admin/bzrmerge.el
index e9fd0ea00f8..350f3795c52 100644
--- a/admin/bzrmerge.el
+++ b/admin/bzrmerge.el
@@ -1,4 +1,4 @@
1;;; bzrmerge.el --- 1;;; bzrmerge.el --- help merge one Emacs bzr branch to another
2 2
3;; Copyright (C) 2010-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
4 4
@@ -20,7 +20,7 @@
20 20
21;;; Commentary: 21;;; Commentary:
22 22
23;; 23;; Some usage notes are in admin/notes/bzr.
24 24
25;;; Code: 25;;; Code:
26 26
@@ -32,10 +32,13 @@
32 "Regexp matching logs of revisions that might be skipped. 32 "Regexp matching logs of revisions that might be skipped.
33`bzrmerge-missing' will ask you if it should skip any matches.") 33`bzrmerge-missing' will ask you if it should skip any matches.")
34 34
35(defconst bzrmerge-buffer "*bzrmerge*"
36 "Working buffer for bzrmerge.")
37
35(defun bzrmerge-merges () 38(defun bzrmerge-merges ()
36 "Return the list of already merged (not yet committed) revisions. 39 "Return the list of already merged (not yet committed) revisions.
37The list returned is sorted by oldest-first." 40The list returned is sorted by oldest-first."
38 (with-current-buffer (get-buffer-create "*bzrmerge*") 41 (with-current-buffer (get-buffer-create bzrmerge-buffer)
39 (erase-buffer) 42 (erase-buffer)
40 ;; We generally want to make sure we start with a clean tree, but we also 43 ;; We generally want to make sure we start with a clean tree, but we also
41 ;; want to allow restarts (i.e. with some part of FROM already merged but 44 ;; want to allow restarts (i.e. with some part of FROM already merged but
@@ -99,7 +102,7 @@ MERGES is the revisions already merged but not yet committed.
99Asks about skipping revisions with logs matching `bzrmerge-skip-regexp'. 102Asks about skipping revisions with logs matching `bzrmerge-skip-regexp'.
100The result is of the form (TOMERGE . TOSKIP) where TOMERGE and TOSKIP 103The result is of the form (TOMERGE . TOSKIP) where TOMERGE and TOSKIP
101are both lists of revnos, in oldest-first order." 104are both lists of revnos, in oldest-first order."
102 (with-current-buffer (get-buffer-create "*bzrmerge*") 105 (with-current-buffer (get-buffer-create bzrmerge-buffer)
103 (erase-buffer) 106 (erase-buffer)
104 (call-process "bzr" nil t nil "missing" "--theirs-only" 107 (call-process "bzr" nil t nil "missing" "--theirs-only"
105 (expand-file-name from)) 108 (expand-file-name from))
@@ -133,7 +136,8 @@ are both lists of revnos, in oldest-first order."
133 (push revno skipped) 136 (push revno skipped)
134 (push revno revnos))))) 137 (push revno revnos)))))
135 (delete-region (point) (point-max))) 138 (delete-region (point) (point-max)))
136 (cons (nreverse revnos) (nreverse skipped))))) 139 (and (or revnos skipped)
140 (cons (nreverse revnos) (nreverse skipped))))))
137 141
138(defun bzrmerge-resolve (file) 142(defun bzrmerge-resolve (file)
139 (unless (file-exists-p file) (error "Bzrmerge-resolve: Can't find %s" file)) 143 (unless (file-exists-p file) (error "Bzrmerge-resolve: Can't find %s" file))
@@ -216,7 +220,7 @@ Does not make other difference."
216 220
217(defun bzrmerge-apply (missing from) 221(defun bzrmerge-apply (missing from)
218 (setq from (expand-file-name from)) 222 (setq from (expand-file-name from))
219 (with-current-buffer (get-buffer-create "*bzrmerge*") 223 (with-current-buffer (get-buffer-create bzrmerge-buffer)
220 (erase-buffer) 224 (erase-buffer)
221 (when (equal (cdr bzrmerge-already-done) (list from missing)) 225 (when (equal (cdr bzrmerge-already-done) (list from missing))
222 (setq missing (car bzrmerge-already-done))) 226 (setq missing (car bzrmerge-already-done)))
@@ -285,7 +289,7 @@ Does not make other difference."
285 ;; bzrmerge-add-metadata does not work when there 289 ;; bzrmerge-add-metadata does not work when there
286 ;; are conflicts. 290 ;; are conflicts.
287 (display-warning 'bzrmerge "Resolve conflicts manually. 291 (display-warning 'bzrmerge "Resolve conflicts manually.
288¡BEWARE! Important metadata is kept in this Emacs session! 292¡BEWARE! Important metadata is kept in this Emacs session!
289Do not commit without re-running `M-x bzrmerge' first!")) 293Do not commit without re-running `M-x bzrmerge' first!"))
290 (error "Resolve conflicts manually"))))) 294 (error "Resolve conflicts manually")))))
291 (cons merge skip))))) 295 (cons merge skip)))))
@@ -309,8 +313,11 @@ Do not commit without re-running `M-x bzrmerge' first!"))
309 (let* ((merges (bzrmerge-merges)) 313 (let* ((merges (bzrmerge-merges))
310 ;; OK, we have the status, now check the missing data. 314 ;; OK, we have the status, now check the missing data.
311 (missing (bzrmerge-missing from merges))) 315 (missing (bzrmerge-missing from merges)))
312 (while missing 316 (if (not missing)
313 (setq missing (bzrmerge-apply missing from)))))) 317 (message "Merging from %s...nothing to merge" from)
318 (while missing
319 (setq missing (bzrmerge-apply missing from)))
320 (message "Merging from %s...done" from)))))
314 321
315(provide 'bzrmerge) 322(provide 'bzrmerge)
316;;; bzrmerge.el ends here 323;;; bzrmerge.el ends here