summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-09-11 23:21:33 -0700
committerGlenn Morris <rgm@gnu.org>2013-09-11 23:21:33 -0700
commita6ae021fd380c089f25ebbc341fb1c989827ae32 (patch)
tree6fdc57937d38d13a70b92b9014e4f769502b2760 /lisp
parent40e64f0cbd0a3457b29b3e38d1424c37b7b4a03f (diff)
downloademacs-a6ae021fd380c089f25ebbc341fb1c989827ae32.tar.gz
* vc/vc-svn.el (vc-svn-parse-status): If there are multiple files
in the status output, assume `filename' is the first. Fixes: debbugs:15322
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/vc/vc-svn.el16
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 37f63216ff6..37005de6776 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2013-09-12 Glenn Morris <rgm@gnu.org>
+ * vc/vc-svn.el (vc-svn-parse-status): If there are multiple files
+ in the status output, assume `filename' is the first. (Bug#15322)
+
* vc/vc.el (vc-deduce-fileset): Doc fix.
* calc/calc-help.el (Info-goto-node):
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index afc76c09742..bfd608c0467 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -674,19 +674,23 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
(defun vc-svn-parse-status (&optional filename)
"Parse output of \"svn status\" command in the current buffer.
-Set file properties accordingly. Unless FILENAME is non-nil, parse only
-information about FILENAME and return its status."
- (let (file status propstat)
+Set file properties accordingly. If FILENAME is non-nil, return its status."
+ (let (multifile file status propstat)
(goto-char (point-min))
(while (re-search-forward
;; Ignore the files with status X.
"^\\(?:\\?\\|[ ACDGIMR!~][ MC][ L][ +][ S]..\\([ *]\\) +\\([-0-9]+\\) +\\([0-9?]+\\) +\\([^ ]+\\)\\) +" nil t)
;; If the username contains spaces, the output format is ambiguous,
;; so don't trust the output's filename unless we have to.
- (setq file (or filename
+ (setq file (or (unless multifile filename)
(expand-file-name
- (buffer-substring (point) (line-end-position)))))
- (setq status (char-after (line-beginning-position))
+ (buffer-substring (point) (line-end-position))))
+ ;; If we are parsing the result of running status on a directory,
+ ;; there could be multiple files in the output.
+ ;; We assume that filename, if supplied, applies to the first
+ ;; listed file (ie, the directory). Bug#15322.
+ multifile t
+ status (char-after (line-beginning-position))
;; Status of the item's properties ([ MC]).
propstat (char-after (1+ (line-beginning-position))))
(if (eq status ??)