emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103091: bzrmerge.el trivia.


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103091: bzrmerge.el trivia.
Date: Wed, 02 Feb 2011 23:09:50 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103091
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2011-02-02 23:09:50 -0800
message:
  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.
modified:
  admin/ChangeLog
  admin/bzrmerge.el
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2011-01-31 19:36:08 +0000
+++ b/admin/ChangeLog   2011-02-03 07:09:50 +0000
@@ -1,7 +1,15 @@
+2011-02-03  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
-       * 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  <address@hidden>
 

=== modified file 'admin/bzrmerge.el'
--- a/admin/bzrmerge.el 2011-01-25 05:10:02 +0000
+++ b/admin/bzrmerge.el 2011-02-03 07:09:50 +0000
@@ -1,4 +1,4 @@
-;;; bzrmerge.el --- 
+;;; bzrmerge.el --- help merge one Emacs bzr branch to another
 
 ;; Copyright (C) 2010-2011  Free Software Foundation, Inc.
 
@@ -20,7 +20,7 @@
 
 ;;; Commentary:
 
-;; 
+;; Some usage notes are in admin/notes/bzr.
 
 ;;; Code:
 
@@ -32,10 +32,13 @@
   "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
@@ -99,7 +102,7 @@
 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))
@@ -133,7 +136,8 @@
                   (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))
@@ -216,7 +220,7 @@
 
 (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)))
@@ -285,7 +289,7 @@
                   ;; 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)))))
@@ -309,8 +313,11 @@
     (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]