emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/vc-hgcmd 69edbce 71/87: Implement log-search


From: Stefan Monnier
Subject: [elpa] externals/vc-hgcmd 69edbce 71/87: Implement log-search
Date: Sat, 5 Jun 2021 16:11:49 -0400 (EDT)

branch: externals/vc-hgcmd
commit 69edbce52a8687fa22b4eb6ed022c2db062dee3b
Author: muffinmad <andreyk.mad@gmail.com>
Commit: muffinmad <andreyk.mad@gmail.com>

    Implement log-search
---
 vc-hgcmd.el | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/vc-hgcmd.el b/vc-hgcmd.el
index bbeb336..acc95b4 100644
--- a/vc-hgcmd.el
+++ b/vc-hgcmd.el
@@ -5,7 +5,7 @@
 ;; Author: Andrii Kolomoiets <andreyk.mad@gmail.com>
 ;; Keywords: vc
 ;; URL: https://github.com/muffinmad/emacs-vc-hgcmd
-;; Package-Version: 1.8.1
+;; Package-Version: 1.9
 ;; Package-Requires: ((emacs "25.1"))
 
 ;; This file is NOT part of GNU Emacs.
@@ -62,6 +62,7 @@
 ;; * print-log (files buffer &optional shortlog start-revision limit)  OK but 
graph log if shortlog
 ;; * log-outgoing (backend remote-location)        OK
 ;; * log-incoming (backend remote-location)        OK
+;; - log-search (buffer pattern)                   OK
 ;; - log-view-mode ()                              OK
 ;; - show-log-entry (revision)                     OK
 ;; - comment-history (file)                        NO
@@ -1083,6 +1084,20 @@ Insert output to process buffer and check if amount of 
data is enought to parse
   "Log incoming from REMOTE-LOCATION to BUFFER."
   (vc-hgcmd--log-in-or-out "incoming" buffer remote-location))
 
+(defun vc-hgcmd-log-search (buffer pattern)
+  "Search the change log for keyword PATTERN and output results into BUFFER.
+
+PATTERN is passed as argument to 'hg log -k' command.
+
+With prefix argument, ask for 'log' command arguments."
+  (let ((args (if current-prefix-arg
+                  (split-string-and-unquote
+                   (read-shell-command
+                    "Search log with command 'hg log': "
+                    "-k "))
+                (list "-k" pattern))))
+    (apply #'vc-hgcmd-command-to-buffer buffer (nconc (list "log") args))))
+
 (defun vc-hgcmd--graph-data-re (re)
   "Add graph data re to RE."
   (concat "^\\(?:[o@_x*+-~|/: ]*\\)" re))



reply via email to

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