emacs-devel
[Top][All Lists]
Advanced

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

Re: New VC mode -- review request


From: Thien-Thi Nguyen
Subject: Re: New VC mode -- review request
Date: Thu, 04 Oct 2007 09:18:58 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

() "Eric S. Raymond" <address@hidden>
() Wed, 3 Oct 2007 13:00:48 -0400

   Dan Nicolaescu <address@hidden>:
   >   >          vc-rollback = C-x v c
   > 
   > Do you have an implementation for this function for any
   > backend? It would be interesting to see it.

   There is one for SCCS in old VC if you want to look at it.  I
   think I at one point implemented it for one other backend, but
   the code and concept were so dodgy that I decided it was best
   shot through the head.

here is the implementation i use for cvs:

(defun ttn-cvs-cancel-version (file editable)
  "Undo the most recent checkin of FILE then do \"cvs update\".
EDITABLE non-nil means do \"cvs edit\" afterwards."
  (unless (and (stringp vc-mode)
               (string= " CVS-" (substring vc-mode 0 5)))
    (error "File locally modified, aborting"))
  (let ((rev (substring vc-mode 5)))
    (vc-cvs-command nil 0 file "admin" (concat "-o" rev))
    (vc-cvs-command nil 0 file "update")
    (when editable
      (vc-cvs-command nil 0 file "edit"))))

(defun ttn-cvs-rollback (files)
  ;; Usage: (defalias 'vc-cvs-rollback 'ttn-cvs-rollback)
  "Undo the most recent checkin of FILE then do \"cvs update\"."
  (ttn-cvs-cancel-version (car files) nil))

although rollback and cancel-version, before that, are shunned, i
find them useful for lone-programmer (ttn-only) situations where
admin/recovery overhead for mistakes is tolerable.  i think we
should provide them but continue to urge their avoidance for
shared-repo situations, however.  the "we don't provide it because
you shouldn't do that" tone has always bothered me gutterally.

thi




reply via email to

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