comparison lisp/pcvs.el @ 50956:510251277445

(cvs-retrieve-revision): Make sure HEAD gets you the head of the branch.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 12 May 2003 17:49:22 +0000
parents fa1c848a9779
children d20464e3d617
comparison
equal deleted inserted replaced
50955:7a718ea39fba 50956:510251277445
1 ;;; pcvs.el --- a front-end to CVS 1 ;;; pcvs.el --- a front-end to CVS
2 2
3 ;; Copyright (C) 1991,92,93,94,95,95,97,98,99,2000,2002 3 ;; Copyright (C) 1991,92,93,94,95,95,97,98,99,2000,02,2003
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com 6 ;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com
7 ;; (Per Cederqvist) ceder@lysator.liu.se 7 ;; (Per Cederqvist) ceder@lysator.liu.se
8 ;; (Greg A. Woods) woods@weird.com 8 ;; (Greg A. Woods) woods@weird.com
1636 (with-current-buffer (create-file-buffer buffile) 1636 (with-current-buffer (create-file-buffer buffile)
1637 (message "Retrieving revision %s..." rev) 1637 (message "Retrieving revision %s..." rev)
1638 ;; Discard stderr output to work around the CVS+SSH+libc 1638 ;; Discard stderr output to work around the CVS+SSH+libc
1639 ;; problem when stdout and stderr are the same. 1639 ;; problem when stdout and stderr are the same.
1640 ;; FIXME: this doesn't seem to make any difference :-( 1640 ;; FIXME: this doesn't seem to make any difference :-(
1641 (let ((res (call-process cvs-program nil '(t . nil) nil 1641 (let ((res (apply 'call-process cvs-program nil '(t . nil) nil
1642 "-q" "update" "-p" "-r" rev file))) 1642 "-q" "update" "-p"
1643 ;; If `rev' is HEAD, don't pass it at all:
1644 ;; the default behavior is to get the head
1645 ;; of the current branch whereas "-r HEAD"
1646 ;; stupidly gives you the head of the trunk.
1647 (append (unless (equal rev "HEAD") (list "-r" rev))
1648 (list file)))))
1643 (when (and res (not (and (equal 0 res)))) 1649 (when (and res (not (and (equal 0 res))))
1644 (error "Something went wrong retrieving revision %s: %s" rev res)) 1650 (error "Something went wrong retrieving revision %s: %s" rev res))
1645 (set-buffer-modified-p nil) 1651 (set-buffer-modified-p nil)
1646 (let ((buffer-file-name (expand-file-name file))) 1652 (let ((buffer-file-name (expand-file-name file)))
1647 (after-find-file)) 1653 (after-find-file))