comparison lisp/vc-git.el @ 85459:dec6fdd5ddf4

(vc-git-revision-completion-table, vc-git-revision-table): Make it work when the arg is a list of files.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 20 Oct 2007 01:09:59 +0000
parents b16f7408cd3f
children 43a9834cf1a6
comparison
equal deleted inserted replaced
85458:119299b8a040 85459:dec6fdd5ddf4
317 (let ((buf (or buffer "*vc-diff*"))) 317 (let ((buf (or buffer "*vc-diff*")))
318 (if (and rev1 rev2) 318 (if (and rev1 rev2)
319 (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--") 319 (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--")
320 (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" (or rev1 "HEAD") "--")))) 320 (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" (or rev1 "HEAD") "--"))))
321 321
322 (defun vc-git-revision-table (file) 322 (defun vc-git-revision-table (files)
323 ;; What about `files'?!? --Stef
323 (let ((table (list "HEAD"))) 324 (let ((table (list "HEAD")))
324 (with-temp-buffer 325 (with-temp-buffer
325 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)") 326 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
326 (goto-char (point-min)) 327 (goto-char (point-min))
327 (while (re-search-forward "^refs/\\(heads\\|tags\\)/\\(.*\\)$" nil t) 328 (while (re-search-forward "^refs/\\(heads\\|tags\\)/\\(.*\\)$" nil t)
328 (push (match-string 2) table))) 329 (push (match-string 2) table)))
329 table)) 330 table))
330 331
331 (defun vc-git-revision-completion-table (file) 332 (defun vc-git-revision-completion-table (files)
332 (lexical-let ((file file) 333 (lexical-let ((files files)
333 table) 334 table)
334 (setq table (lazy-completion-table 335 (setq table (lazy-completion-table
335 table (lambda () (vc-git-revision-table file)))) 336 table (lambda () (vc-git-revision-table files))))
336 table)) 337 table))
337 338
338 (defun vc-git-diff-tree (dir &optional rev1 rev2) 339 (defun vc-git-diff-tree (dir &optional rev1 rev2)
339 (vc-git-diff dir rev1 rev2)) 340 (vc-git-diff dir rev1 rev2))
340 341