chiark / gitweb /
stgit.el: Garbage collect selected patches on reload
authorGustav Hållberg <gustav@virtutech.com>
Fri, 31 Jul 2009 08:55:26 +0000 (10:55 +0200)
committerGustav Hållberg <gustav@virtutech.com>
Thu, 6 Aug 2009 20:49:07 +0000 (22:49 +0200)
Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
contrib/stgit.el

index 01a44d2d728e9a9b5182faeedf3dd250630b1554..3ce2eaf55d9674cdcb30175e728e93f2157b2132 100644 (file)
@@ -198,7 +198,8 @@ (defun stgit-run-series (ewoc)
         stgit-worktree-node nil)
   (let ((inserted-index (not stgit-show-worktree))
         index-node
-        worktree-node)
+        worktree-node
+        all-patchsyms)
     (with-temp-buffer
       (let ((exit-status (stgit-run-silent "series" "--description" "--empty")))
         (goto-char (point-min))
@@ -228,6 +229,7 @@ (defun stgit-run-series (ewoc)
                                (eq state 'unapplied)))
                   (setq inserted-index t)
                   (stgit-run-series-insert-index ewoc)))
+              (setq all-patchsyms (cons name all-patchsyms))
               (ewoc-enter-last ewoc
                                (make-stgit-patch
                                 :status state
@@ -238,7 +240,9 @@ (defun stgit-run-series (ewoc)
       (unless inserted-index
         (stgit-run-series-insert-index ewoc)))
     (setq stgit-index-node    index-node
-          stgit-worktree-node worktree-node)))
+          stgit-worktree-node worktree-node
+          stgit-marked-patches (intersection stgit-marked-patches
+                                             all-patchsyms))))
 
 (defun stgit-reload ()
   "Update the contents of the StGit buffer."