stgit.el: Repair ! for historical commits
authorGustav Hållberg <gustav@gmail.com>
Wed, 12 May 2010 18:14:14 +0000 (20:14 +0200)
committerGustav Hållberg <gustav@gmail.com>
Thu, 10 Jun 2010 07:25:25 +0000 (09:25 +0200)
Fixes omission in 8f489f41f8ffe6e06254cefc5b352610df06cbeb.

Signed-off-by: Gustav Hållberg <gustav@gmail.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
contrib/stgit.el

index 487b891..b72ba98 100644 (file)
@@ -2331,16 +2331,13 @@ their position in the patch series, bottommost first.
 
 PATCHSYMS must not contain duplicate entries, unless
 ALLOW-DUPLICATES is not nil."
-  (let (sorted-patchsyms
-        (series (with-output-to-string
-                  (with-current-buffer standard-output
-                    (stgit-run-silent "series" "--noprefix"))))
-        start)
-    (while (string-match "^\\(.+\\)" series start)
-      (let ((patchsym (intern (match-string 1 series))))
-        (when (memq patchsym patchsyms)
-          (setq sorted-patchsyms (cons patchsym sorted-patchsyms))))
-      (setq start (match-end 0)))
+  (let (sorted-patchsyms)
+    (ewoc-map #'(lambda (patch)
+                  (let ((name (stgit-patch->name patch)))
+                    (when (memq name patchsyms)
+                      (setq sorted-patchsyms (cons name sorted-patchsyms))))
+                  nil)
+              stgit-ewoc)
     (setq sorted-patchsyms (nreverse sorted-patchsyms))
 
     (unless allow-duplicates