[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-hgcmd da539aa 78/87: Skip lines with unknow status w
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vc-hgcmd da539aa 78/87: Skip lines with unknow status while parsing 'hg status' |
Date: |
Sat, 5 Jun 2021 16:11:51 -0400 (EDT) |
branch: externals/vc-hgcmd
commit da539aaa348ac55c9f2d09fee10b51300f34106a
Author: muffinmad <andreyk.mad@gmail.com>
Commit: muffinmad <andreyk.mad@gmail.com>
Skip lines with unknow status while parsing 'hg status'
With 'ui.verbose' option turned on there are some additional lines in
'status' output:
```
# The repository is in an unfinished *merge* state.
# Unresolved merge conflicts:
#
# .hgtags
# main.py
#
# To mark files as resolved: hg resolve --mark FILE
# To continue: hg commit
# To abort: hg merge --abort
```
---
vc-hgcmd.el | 51 ++++++++++++++++++++++++++-------------------------
1 file changed, 26 insertions(+), 25 deletions(-)
diff --git a/vc-hgcmd.el b/vc-hgcmd.el
index 0498696..50e5808 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.9.2
+;; Package-Version: 1.9.3
;; Package-Requires: ((emacs "25.1"))
;; This file is NOT part of GNU Emacs.
@@ -649,30 +649,31 @@ Insert output to process buffer and check if amount of
data is enought to parse
(conflicted (mapcar #'car conflicted)))
(goto-char (point-min))
(while (not (eobp))
- (let ((file (buffer-substring-no-properties (+ (point) 2)
(line-end-position)))
- (status (cdr (assoc (char-after) vc-hgcmd--translation-status))))
- (unless (or (member file conflicted) (eq status 'origin))
- (push (list
- file
- status
- (pcase status
- ('added (save-excursion
- (forward-line)
- (when (and (point-at-bol)
- (eq 'origin (cdr (assoc (char-after)
vc-hgcmd--translation-status))))
- (let ((origin (buffer-substring-no-properties
(+ (point) 2) (line-end-position))))
- (vc-hgcmd-create-extra-fileinfo
- (if (re-search-forward (concat "^R "
(regexp-quote origin) "$") nil t)
- 'renamed-from
- 'copied)
- origin)))))
- ('removed (save-excursion
- (when (re-search-backward (concat "^ "
(regexp-quote file) "$") nil t)
- (forward-line -1)
- (vc-hgcmd-create-extra-fileinfo
- 'renamed-to
- (buffer-substring-no-properties (+ (point)
2) (line-end-position))))))))
- result)))
+ (let ((status (cdr (assoc (char-after) vc-hgcmd--translation-status))))
+ (when status
+ (let ((file (buffer-substring-no-properties (+ (point) 2)
(line-end-position))))
+ (unless (or (member file conflicted) (eq status 'origin))
+ (push (list
+ file
+ status
+ (pcase status
+ ('added (save-excursion
+ (forward-line)
+ (when (and (point-at-bol)
+ (eq 'origin (cdr (assoc
(char-after) vc-hgcmd--translation-status))))
+ (let ((origin
(buffer-substring-no-properties (+ (point) 2) (line-end-position))))
+ (vc-hgcmd-create-extra-fileinfo
+ (if (re-search-forward (concat "^R "
(regexp-quote origin) "$") nil t)
+ 'renamed-from
+ 'copied)
+ origin)))))
+ ('removed (save-excursion
+ (when (re-search-backward (concat "^ "
(regexp-quote file) "$") nil t)
+ (forward-line -1)
+ (vc-hgcmd-create-extra-fileinfo
+ 'renamed-to
+ (buffer-substring-no-properties (+
(point) 2) (line-end-position))))))))
+ result)))))
(forward-line))
(funcall update-function result)))
- [elpa] externals/vc-hgcmd 1f7e6d0 67/87: View changes made by revision; diff to parents, (continued)
- [elpa] externals/vc-hgcmd 1f7e6d0 67/87: View changes made by revision; diff to parents, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 69edbce 71/87: Implement log-search, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 01447f9 49/87: Set LANGUAGE=C, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd b82518f 52/87: Functions implementation status in commentary, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 3ee691d 55/87: Wrong heading in readme, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd ce36707 56/87: Find proper filename across renames on diff, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd fc7b852 57/87: Don't retrieve files for fileless diff; region-history, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 0b052a6 69/87: Suppress untrusted hgrc warning, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 4036564 73/87: Show all 'summary' output, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 45000c8 75/87: Don't append extra empty line in vc-dir, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd da539aa 78/87: Skip lines with unknow status while parsing 'hg status',
Stefan Monnier <=
- [elpa] externals/vc-hgcmd 44afcf1 80/87: Shortlog, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 8fc2e2c 79/87: Run command in current buffer rather then in output buffer, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 5c735b3 86/87: Implement repository-url, Stefan Monnier, 2021/06/05