bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16254: 24.3.50; bzr error on emacs trunk using vc-print-log


From: Christoph
Subject: bug#16254: 24.3.50; bzr error on emacs trunk using vc-print-log
Date: Thu, 26 Dec 2013 19:47:07 -0700

This issue seems to be that when deducing the fileset in dired mode, the code does not distinguish between files that are under version control and files that aren't.

The following patch adds detection (and filtering) of unregistered members to vc-dired-deduce-fileset.
If the marked files have any unregistered files among them, the unregistered files are filtered out. 
If all files are unregistered, an error is shown. This also covers the main case of selecting just one unregistered file/directory.

Thoughts?

=== modified file 'lisp/vc/vc.el'
--- lisp/vc/vc.el 2013-11-26 19:17:55 +0000
+++ lisp/vc/vc.el 2013-12-27 02:40:38 +0000
@@ -1014,10 +1014,19 @@
      (t (error "File is not under version control")))))
 
 (defun vc-dired-deduce-fileset ()
-  (let ((backend (vc-responsible-backend default-directory)))
-    (unless backend (error "Directory not under VC"))
-    (list backend
-          (dired-map-over-marks (dired-get-filename nil t) nil))))
+  "Deduce a set of files and a backend to which to apply an
+operation from all the marked items in a dired buffer. Resulting
+fileset only includes items that are version controlled."
+  (let ((backend (vc-responsible-backend default-directory))
+        (fileset
+         (delq nil (mapcar
+                    (lambda (x) (if (not (equal (vc-backend x) nil)) x))
+                    (dired-map-over-marks
+                     (dired-get-filename nil t)
+                     nil)))))
+    (if (not fileset)
+        (error "Marked fileset is not under version control")
+      (list backend fileset))))
 
 (defun vc-ensure-vc-buffer ()
   "Make sure that the current buffer visits a version-controlled file."



On Wed, Dec 25, 2013 at 11:35 AM, Christoph <cschol2112@gmail.com> wrote:
I was wrong. The t argument in vc-deduce-fileset does something else. Sorry for the noise.



On Wed, Dec 25, 2013 at 11:22 AM, Christoph <cschol2112@gmail.com> wrote:
vc-print-log was executed from a dired buffer when this happened. vc-print-root-log works correctly and prints the Emacs bzr logs.

vc.el has the following code in vc-print-log:

  (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
(backend (car vc-fileset))
(files (cadr vc-fileset))
;; (working-revision (or working-revision (vc-working-revision (car files))))
         )
    (vc-print-log-internal backend files working-revision nil limit)))

The t in vc-decude-fileset allows unregistered files per the documentation. To follow Stefan's questions, why would we want unregistered files to be included in the fileset for the log command?

I think this should be changed to disallow unregistered files.

Christoph


On Wed, Dec 25, 2013 at 10:54 AM, Christoph <cschol2112@gmail.com> wrote:
Some more information on this issue: 

`vc-print-log` works find in a sub-directory of the tree, e.g. admin.
It looks like aclocal.m4 is ignored via .bzrignore and it is the first file in the root tree (after running configure and such).

I seem to remember we had a similar problem before that was fixed at some point.


On Wed, Dec 25, 2013 at 10:25 AM, Christoph <cschol2112@gmail.com> wrote:

Running `vc-print-log` on a directory containing the Emacs trunk gives
the following error:

bzr: ERROR: Path unknown at end or start of revision range: aclocal.m4



In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2013-12-14 on marvin
Bzr revision: 115528 tzz@lifelogs.com-20131214195519-pi759t6a59vg9b1i
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:     Linux Mint 13 Maya





reply via email to

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