Mercurial > emacs
comparison lisp/vc-cvs.el @ 44462:6eb10924e77f
(vc-cvs-valid-version-number-p): New function.
(vc-cvs-checkin): Use it.
author | Sam Steingold <sds@gnu.org> |
---|---|
date | Tue, 09 Apr 2002 17:13:51 +0000 |
parents | f9db51bb423b |
children | 20c79f08a7da |
comparison
equal
deleted
inserted
replaced
44461:91b326cb58d1 | 44462:6eb10924e77f |
---|---|
3 ;; Copyright (C) 1995,98,99,2000,2001 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1995,98,99,2000,2001 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: FSF (see vc.el for full credits) | 5 ;; Author: FSF (see vc.el for full credits) |
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
7 | 7 |
8 ;; $Id: vc-cvs.el,v 1.38 2002/03/28 14:27:30 spiegel Exp $ | 8 ;; $Id: vc-cvs.el,v 1.39 2002/04/08 13:38:48 sds Exp $ |
9 | 9 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
320 "CVS-specific version of `vc-backend-checkin'." | 320 "CVS-specific version of `vc-backend-checkin'." |
321 (let ((switches (if (stringp vc-checkin-switches) | 321 (let ((switches (if (stringp vc-checkin-switches) |
322 (list vc-checkin-switches) | 322 (list vc-checkin-switches) |
323 vc-checkin-switches)) | 323 vc-checkin-switches)) |
324 status) | 324 status) |
325 (if (not rev) | 325 (if (or (not rev) (vc-cvs-valid-version-number-p rev)) |
326 (setq status (apply 'vc-cvs-command nil 1 file | 326 (setq status (apply 'vc-cvs-command nil 1 file |
327 "ci" (if rev (concat "-r" rev)) | 327 "ci" (if rev (concat "-r" rev)) |
328 (concat "-m" comment) | 328 (concat "-m" comment) |
329 switches)) | 329 switches)) |
330 (if (not (vc-cvs-valid-symbolic-tag-name-p rev)) | 330 (if (not (vc-cvs-valid-symbolic-tag-name-p rev)) |
814 ;; an uppercase or lowercase letter and can contain uppercase and | 814 ;; an uppercase or lowercase letter and can contain uppercase and |
815 ;; lowercase letters, digits, `-', and `_'. | 815 ;; lowercase letters, digits, `-', and `_'. |
816 (and (string-match "^[a-zA-Z]" tag) | 816 (and (string-match "^[a-zA-Z]" tag) |
817 (not (string-match "[^a-z0-9A-Z-_]" tag)))) | 817 (not (string-match "[^a-z0-9A-Z-_]" tag)))) |
818 | 818 |
819 (defun vc-cvs-valid-version-number-p (tag) | |
820 "Return non-nil if TAG is a valid version number." | |
821 (and (string-match "^[0-9]" tag) | |
822 (not (string-match "[^0-9.]" tag)))) | |
819 | 823 |
820 (defun vc-cvs-parse-sticky-tag (match-type match-tag) | 824 (defun vc-cvs-parse-sticky-tag (match-type match-tag) |
821 "Parse and return the sticky tag as a string. | 825 "Parse and return the sticky tag as a string. |
822 `match-data' is protected." | 826 `match-data' is protected." |
823 (let ((data (match-data)) | 827 (let ((data (match-data)) |