]> git.eshelyaron.com Git - emacs.git/commitdiff
Use the VC root in `log-edit-listfun'
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 10 Apr 2015 00:54:55 +0000 (03:54 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 10 Apr 2015 00:54:55 +0000 (03:54 +0300)
* lisp/vc/vc-dispatcher.el (vc-log-edit): Use the VC root in
`log-edit-listfun'.

lisp/vc/vc-dispatcher.el

index 4f8ec2788964869d1ef7ba33c9ccba88f40ac010..8b3e888f700721d2d6dcc017bed6be2d3e7594ad 100644 (file)
@@ -604,11 +604,20 @@ NOT-URGENT means it is ok to continue if the user says not to save."
            (or (log-edit-empty-buffer-p)
                (and (local-variable-p 'vc-log-fileset)
                     (not (equal vc-log-fileset fileset))))
-           `((log-edit-listfun . (lambda ()
-                                    ;; FIXME: Should expand the list
-                                    ;; for directories.
-                                    (mapcar 'file-relative-name
-                                            ',fileset)))
+           `((log-edit-listfun
+               . (lambda ()
+                   ;; FIXME: Should expand the list for directories.
+                   ;; Is the above still relevant?  If so, it needs a
+                   ;; better explanation. -- dgutov
+                   (let ((root (vc-root-dir)))
+                     ;; Returns paths relative to the root, so that
+                     ;; `log-edit-changelog-insert-entries'
+                     ;; substitutes them in correctly later, even when
+                     ;; `vc-checkin' was called from a file buffer, or
+                     ;; a non-root VC-Dir buffer.
+                     (mapcar
+                      (lambda (file) (file-relative-name file root))
+                      ',fileset))))
              (log-edit-diff-function . vc-diff)
              (log-edit-vc-backend . ,backend)
              (vc-log-fileset . ,fileset))