(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
;;; vc-cvs.el --- non-resident support for CVS version-control
|
|
|
|
|
2005-08-06 22:13:43 +00:00
|
|
|
;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003,
|
2008-01-05 05:19:00 +00:00
|
|
|
;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
|
|
|
;; Author: FSF (see vc.el for full credits)
|
|
|
|
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
|
|
|
|
|
2004-11-03 14:16:14 +00:00
|
|
|
;; $Id$
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2007-07-25 04:50:21 +00:00
|
|
|
;; the Free Software Foundation; either version 3, or (at your option)
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
;; any later version.
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
2005-07-04 23:32:44 +00:00
|
|
|
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
;; Boston, MA 02110-1301, USA.
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2007-07-12 03:13:37 +00:00
|
|
|
(eval-when-compile (require 'cl) (require 'vc))
|
2001-01-25 21:02:37 +00:00
|
|
|
|
2007-07-12 03:10:45 +00:00
|
|
|
;; Clear up the cache to force vc-call to check again and discover
|
|
|
|
;; new functions when we reload this file.
|
|
|
|
(put 'CVS 'vc-functions nil)
|
|
|
|
|
2001-01-25 16:36:48 +00:00
|
|
|
;;;
|
2000-11-16 18:14:41 +00:00
|
|
|
;;; Customization options
|
|
|
|
;;;
|
|
|
|
|
2002-03-28 14:29:06 +00:00
|
|
|
(defcustom vc-cvs-global-switches nil
|
|
|
|
"*Global switches to pass to any CVS command."
|
|
|
|
:type '(choice (const :tag "None" nil)
|
|
|
|
(string :tag "Argument String")
|
|
|
|
(repeat :tag "Argument List"
|
|
|
|
:value ("")
|
|
|
|
string))
|
2005-02-09 15:50:47 +00:00
|
|
|
:version "22.1"
|
2002-03-28 14:29:06 +00:00
|
|
|
:group 'vc)
|
|
|
|
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(defcustom vc-cvs-register-switches nil
|
|
|
|
"*Extra switches for registering a file into CVS.
|
|
|
|
A string or list of strings passed to the checkin program by
|
|
|
|
\\[vc-register]."
|
|
|
|
:type '(choice (const :tag "None" nil)
|
|
|
|
(string :tag "Argument String")
|
|
|
|
(repeat :tag "Argument List"
|
|
|
|
:value ("")
|
|
|
|
string))
|
2000-09-07 20:01:53 +00:00
|
|
|
:version "21.1"
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
:group 'vc)
|
|
|
|
|
2001-02-01 15:10:16 +00:00
|
|
|
(defcustom vc-cvs-diff-switches nil
|
|
|
|
"*A string or list of strings specifying extra switches for cvs diff under VC."
|
|
|
|
:type '(choice (const :tag "None" nil)
|
|
|
|
(string :tag "Argument String")
|
|
|
|
(repeat :tag "Argument List"
|
|
|
|
:value ("")
|
|
|
|
string))
|
|
|
|
:version "21.1"
|
|
|
|
:group 'vc)
|
|
|
|
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$"))
|
|
|
|
"*Header keywords to be inserted by `vc-insert-headers'."
|
2000-09-07 20:01:53 +00:00
|
|
|
:version "21.1"
|
2001-01-09 14:48:25 +00:00
|
|
|
:type '(repeat string)
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
:group 'vc)
|
|
|
|
|
|
|
|
(defcustom vc-cvs-use-edit t
|
|
|
|
"*Non-nil means to use `cvs edit' to \"check out\" a file.
|
|
|
|
This is only meaningful if you don't use the implicit checkout model
|
|
|
|
\(i.e. if you have $CVSREAD set)."
|
|
|
|
:type 'boolean
|
2000-09-07 20:01:53 +00:00
|
|
|
:version "21.1"
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
:group 'vc)
|
|
|
|
|
2003-04-23 13:14:16 +00:00
|
|
|
(defcustom vc-cvs-stay-local t
|
2000-09-07 20:01:53 +00:00
|
|
|
"*Non-nil means use local operations when possible for remote repositories.
|
2001-07-04 15:51:18 +00:00
|
|
|
This avoids slow queries over the network and instead uses heuristics
|
|
|
|
and past information to determine the current status of a file.
|
2003-04-23 13:14:16 +00:00
|
|
|
|
2003-04-23 12:49:25 +00:00
|
|
|
The value can also be a regular expression or list of regular
|
|
|
|
expressions to match against the host name of a repository; then VC
|
2003-04-23 13:14:16 +00:00
|
|
|
only stays local for hosts that match it. Alternatively, the value
|
2004-11-03 14:16:14 +00:00
|
|
|
can be a list of regular expressions where the first element is the
|
|
|
|
symbol `except'; then VC always stays local except for hosts matched
|
2003-04-23 13:14:16 +00:00
|
|
|
by these regular expressions."
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
:type '(choice (const :tag "Always stay local" t)
|
2003-04-23 12:49:25 +00:00
|
|
|
(const :tag "Don't stay local" nil)
|
2004-11-03 14:16:14 +00:00
|
|
|
(list :format "\nExamine hostname and %v" :tag "Examine hostname ..."
|
2003-04-23 12:49:25 +00:00
|
|
|
(set :format "%v" :inline t (const :format "%t" :tag "don't" except))
|
|
|
|
(regexp :format " stay local,\n%t: %v" :tag "if it matches")
|
|
|
|
(repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
|
2000-09-07 20:01:53 +00:00
|
|
|
:version "21.1"
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
:group 'vc)
|
|
|
|
|
2002-02-21 20:16:47 +00:00
|
|
|
(defcustom vc-cvs-sticky-date-format-string "%c"
|
|
|
|
"*Format string for mode-line display of sticky date.
|
|
|
|
Format is according to `format-time-string'. Only used if
|
|
|
|
`vc-cvs-sticky-tag-display' is t."
|
|
|
|
:type '(string)
|
2005-02-09 15:50:47 +00:00
|
|
|
:version "22.1"
|
2002-02-21 20:16:47 +00:00
|
|
|
:group 'vc)
|
|
|
|
|
|
|
|
(defcustom vc-cvs-sticky-tag-display t
|
|
|
|
"*Specify the mode-line display of sticky tags.
|
|
|
|
Value t means default display, nil means no display at all. If the
|
|
|
|
value is a function or macro, it is called with the sticky tag and
|
|
|
|
its' type as parameters, in that order. TYPE can have three different
|
|
|
|
values: `symbolic-name' (TAG is a string), `revision-number' (TAG is a
|
|
|
|
string) and `date' (TAG is a date as returned by `encode-time'). The
|
|
|
|
return value of the function or macro will be displayed as a string.
|
|
|
|
|
|
|
|
Here's an example that will display the formatted date for sticky
|
|
|
|
dates and the word \"Sticky\" for sticky tag names and revisions.
|
|
|
|
|
|
|
|
(lambda (tag type)
|
2002-04-08 13:38:48 +00:00
|
|
|
(cond ((eq type 'date) (format-time-string
|
2002-02-21 20:16:47 +00:00
|
|
|
vc-cvs-sticky-date-format-string tag))
|
|
|
|
((eq type 'revision-number) \"Sticky\")
|
|
|
|
((eq type 'symbolic-name) \"Sticky\")))
|
|
|
|
|
|
|
|
Here's an example that will abbreviate to the first character only,
|
2002-10-17 15:43:48 +00:00
|
|
|
any text before the first occurrence of `-' for sticky symbolic tags.
|
2002-02-21 20:16:47 +00:00
|
|
|
If the sticky tag is a revision number, the word \"Sticky\" is
|
|
|
|
displayed. Date and time is displayed for sticky dates.
|
|
|
|
|
|
|
|
(lambda (tag type)
|
|
|
|
(cond ((eq type 'date) (format-time-string \"%Y%m%d %H:%M\" tag))
|
|
|
|
((eq type 'revision-number) \"Sticky\")
|
2002-04-08 13:38:48 +00:00
|
|
|
((eq type 'symbolic-name)
|
2002-02-21 20:16:47 +00:00
|
|
|
(condition-case nil
|
|
|
|
(progn
|
|
|
|
(string-match \"\\\\([^-]*\\\\)\\\\(.*\\\\)\" tag)
|
2002-04-08 13:38:48 +00:00
|
|
|
(concat (substring (match-string 1 tag) 0 1) \":\"
|
2002-02-21 20:16:47 +00:00
|
|
|
(substring (match-string 2 tag) 1 nil)))
|
|
|
|
(error tag))))) ; Fall-back to given tag name.
|
|
|
|
|
|
|
|
See also variable `vc-cvs-sticky-date-format-string'."
|
|
|
|
:type '(choice boolean function)
|
2005-02-09 15:50:47 +00:00
|
|
|
:version "22.1"
|
2002-02-21 20:16:47 +00:00
|
|
|
:group 'vc)
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; Internal variables
|
|
|
|
;;;
|
|
|
|
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
2001-01-25 16:36:48 +00:00
|
|
|
;;; State-querying functions
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
;;;###autoload (defun vc-cvs-registered (f)
|
|
|
|
;;;###autoload (when (file-readable-p (expand-file-name
|
|
|
|
;;;###autoload "CVS/Entries" (file-name-directory f)))
|
2002-10-09 15:59:39 +00:00
|
|
|
;;;###autoload (load "vc-cvs")
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
;;;###autoload (vc-cvs-registered f)))
|
|
|
|
|
|
|
|
(defun vc-cvs-registered (file)
|
|
|
|
"Check if FILE is CVS registered."
|
|
|
|
(let ((dirname (or (file-name-directory file) ""))
|
|
|
|
(basename (file-name-nondirectory file))
|
|
|
|
;; make sure that the file name is searched case-sensitively
|
|
|
|
(case-fold-search nil))
|
|
|
|
(if (file-readable-p (expand-file-name "CVS/Entries" dirname))
|
|
|
|
(with-temp-buffer
|
2003-04-05 15:51:14 +00:00
|
|
|
(vc-cvs-get-entries dirname)
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(goto-char (point-min))
|
2000-09-07 20:01:53 +00:00
|
|
|
(cond
|
|
|
|
((re-search-forward
|
2002-03-22 23:10:01 +00:00
|
|
|
;; CVS-removed files are not taken under VC control.
|
|
|
|
(concat "^/" (regexp-quote basename) "/[^/-]") nil t)
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(beginning-of-line)
|
|
|
|
(vc-cvs-parse-entry file)
|
|
|
|
t)
|
|
|
|
(t nil)))
|
|
|
|
nil)))
|
|
|
|
|
|
|
|
(defun vc-cvs-state (file)
|
|
|
|
"CVS-specific version of `vc-state'."
|
2003-07-04 22:40:26 +00:00
|
|
|
(if (vc-stay-local-p file)
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(let ((state (vc-file-getprop file 'vc-state)))
|
|
|
|
;; If we should stay local, use the heuristic but only if
|
|
|
|
;; we don't have a more precise state already available.
|
2004-11-30 11:02:23 +00:00
|
|
|
(if (memq state '(up-to-date edited nil))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(vc-cvs-state-heuristic file)
|
|
|
|
state))
|
|
|
|
(with-temp-buffer
|
|
|
|
(cd (file-name-directory file))
|
2002-03-28 14:29:06 +00:00
|
|
|
(vc-cvs-command t 0 file "status")
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(vc-cvs-parse-status t))))
|
|
|
|
|
|
|
|
(defun vc-cvs-state-heuristic (file)
|
|
|
|
"CVS-specific state heuristic."
|
|
|
|
;; If the file has not changed since checkout, consider it `up-to-date'.
|
|
|
|
;; Otherwise consider it `edited'.
|
|
|
|
(let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
|
|
|
|
(lastmod (nth 5 (file-attributes file))))
|
|
|
|
(if (equal checkout-time lastmod)
|
|
|
|
'up-to-date
|
|
|
|
'edited)))
|
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
(defun vc-cvs-dir-state (dir)
|
2007-12-26 23:24:08 +00:00
|
|
|
"Find the CVS state of all files in DIR and subdirectories."
|
2003-04-19 22:40:18 +00:00
|
|
|
;; if DIR is not under CVS control, don't do anything.
|
|
|
|
(when (file-readable-p (expand-file-name "CVS/Entries" dir))
|
2003-07-04 22:40:26 +00:00
|
|
|
(if (vc-stay-local-p dir)
|
2003-04-19 22:40:18 +00:00
|
|
|
(vc-cvs-dir-state-heuristic dir)
|
|
|
|
(let ((default-directory dir))
|
|
|
|
;; Don't specify DIR in this command, the default-directory is
|
|
|
|
;; enough. Otherwise it might fail with remote repositories.
|
|
|
|
(with-temp-buffer
|
2007-12-28 08:59:50 +00:00
|
|
|
(buffer-disable-undo) ;; Because these buffers can get huge
|
2007-12-26 23:24:08 +00:00
|
|
|
(vc-cvs-command t 0 nil "status")
|
2003-04-19 22:40:18 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t)
|
|
|
|
(narrow-to-region (match-beginning 0) (match-end 0))
|
|
|
|
(vc-cvs-parse-status)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(widen)))))))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
2007-10-10 18:52:45 +00:00
|
|
|
(defun vc-cvs-working-revision (file)
|
|
|
|
"CVS-specific version of `vc-working-revision'."
|
2000-11-16 18:14:41 +00:00
|
|
|
;; There is no need to consult RCS headers under CVS, because we
|
|
|
|
;; get the workfile version for free when we recognize that a file
|
|
|
|
;; is registered in CVS.
|
|
|
|
(vc-cvs-registered file)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-getprop file 'vc-working-revision))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-checkout-model (file)
|
|
|
|
"CVS-specific version of `vc-checkout-model'."
|
2005-05-22 10:29:44 +00:00
|
|
|
(if (getenv "CVSREAD")
|
2000-11-16 18:14:41 +00:00
|
|
|
'announce
|
2005-05-22 10:29:44 +00:00
|
|
|
(let ((attrib (file-attributes file)))
|
|
|
|
(if (and attrib ;; don't check further if FILE doesn't exist
|
|
|
|
;; If the file is not writable (despite CVSREAD being
|
|
|
|
;; undefined), this is probably because the file is being
|
|
|
|
;; "watched" by other developers.
|
|
|
|
;; (If vc-mistrust-permissions was t, we actually shouldn't
|
|
|
|
;; trust this, but there is no other way to learn this from CVS
|
|
|
|
;; at the moment (version 1.9).)
|
|
|
|
(string-match "r-..-..-." (nth 8 attrib)))
|
|
|
|
'announce
|
|
|
|
'implicit))))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: (toplevel): Don't require `dired' at run-time.
(vc-dired-resynch-file): Remove autoload cookie.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc.el: Made several backend functions optional.
(vc-default-responsible-p): New function.
(vc-merge): Use RET for first version to trigger merge-news, not
prefix arg.
(vc-annotate): Handle backends that do not support annotation.
(vc-default-merge-news): Removed. The existence of a merge-news
implementation is now checked on caller sites.
* vc-hooks.el (vc-default-mode-line-string): Removed CVS special
case.
* vc-cvs.el (vc-cvs-mode-line-string): New function, handles the
special case that has been removed from the default in vc-hooks.el.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-log-edit): Properly handle the case where FILE is nil.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc-hooks.el: Require vc during compilation.
(vc-file-setprop): Use `vc-touched-properties' if bound by the new
macro `with-vc-properties' in vc.el.
(vc-file-getprop): Doc fix.
(vc-after-save): Call `vc-dired-resynch-file' only if vc is loaded.
* vc.el: Require dired-aux during compilation.
(vc-name-assoc-file): Moved to vc-sccs.el.
(with-vc-properties): New macro.
(vc-checkin, vc-checkout, vc-revert, vc-cancel-version,
vc-finish-steal): Use it.
(vc-cancel-version): Moved RCS-specific code to vc-rcs.el. The call
to the backend-specific function is now supposed to do the checkout,
too.
(vc-log-edit): Handle FILE being nil and added a FIXME for log-edit.
* vc-cvs.el (vc-cvs-checkin, vc-cvs-checkout): Don't bother to
set file properties; that gets done in the generic code now.
* vc-rcs.el (vc-rcs-uncheck): Renamed to `vc-rcs-cancel-version'.
Changed parameter list, added code from vc.el that does the
checkout, possibly with a double-take.
* vc-sccs.el (vc-sccs-name-assoc-file): Moved here from vc.el.
(vc-sccs-add-triple, vc-sccs-rename-file, vc-sccs-lookup-triple): Use
the above under the new name.
(vc-sccs-uncheck): Renamed to `vc-sccs-cancel-version'. Changed
parameter list, added checkout command.
(vc-sccs-checkin, vc-sccs-checkout): Don't bother to set file
properties; that gets done in the generic code now.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: Docstring fixes (courtesy of checkdoc).
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-checkout-writable-buffer-hook)
(vc-checkout-writable-buffer): Remove.
(vc-start-entry): Always call vc-log-edit, never vc-log-mode.
(vc-log-mode): Make it into a clean derived major mode.
(vc-log-edit): Mark buffer unmodified (as vc-log-mode did) and use
vc-log-mode if log-edit is not available.
(vc-dired-mode-map): Don't set-keymap-parent yet.
(vc-dired-mode): Do set-keymap-parent here.
(vc-dired-buffers-for-dir): Nop if dired is not loaded.
2000-09-05 20:08:22 +00:00
|
|
|
(defun vc-cvs-mode-line-string (file)
|
|
|
|
"Return string for placement into the modeline for FILE.
|
2002-02-21 20:16:47 +00:00
|
|
|
Compared to the default implementation, this function does two things:
|
|
|
|
Handle the special case of a CVS file that is added but not yet
|
|
|
|
committed and support display of sticky tags."
|
2007-07-22 19:04:11 +00:00
|
|
|
(let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
|
|
|
|
help-echo
|
|
|
|
(string
|
2007-10-10 18:52:45 +00:00
|
|
|
(if (string= (vc-working-revision file) "0")
|
2007-07-22 19:04:11 +00:00
|
|
|
;; A file that is added but not yet committed.
|
|
|
|
(progn
|
|
|
|
(setq help-echo "Added file (needs commit) under CVS")
|
|
|
|
"CVS @@")
|
|
|
|
(let ((def-ml (vc-default-mode-line-string 'CVS file)))
|
|
|
|
(setq help-echo
|
|
|
|
(get-text-property 0 'help-echo def-ml))
|
|
|
|
def-ml))))
|
|
|
|
(propertize
|
|
|
|
(if (zerop (length sticky-tag))
|
|
|
|
string
|
|
|
|
(setq help-echo (format "%s on the '%s' branch"
|
|
|
|
help-echo sticky-tag))
|
|
|
|
(concat string "[" sticky-tag "]"))
|
|
|
|
'help-echo help-echo)))
|
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: (toplevel): Don't require `dired' at run-time.
(vc-dired-resynch-file): Remove autoload cookie.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc.el: Made several backend functions optional.
(vc-default-responsible-p): New function.
(vc-merge): Use RET for first version to trigger merge-news, not
prefix arg.
(vc-annotate): Handle backends that do not support annotation.
(vc-default-merge-news): Removed. The existence of a merge-news
implementation is now checked on caller sites.
* vc-hooks.el (vc-default-mode-line-string): Removed CVS special
case.
* vc-cvs.el (vc-cvs-mode-line-string): New function, handles the
special case that has been removed from the default in vc-hooks.el.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-log-edit): Properly handle the case where FILE is nil.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc-hooks.el: Require vc during compilation.
(vc-file-setprop): Use `vc-touched-properties' if bound by the new
macro `with-vc-properties' in vc.el.
(vc-file-getprop): Doc fix.
(vc-after-save): Call `vc-dired-resynch-file' only if vc is loaded.
* vc.el: Require dired-aux during compilation.
(vc-name-assoc-file): Moved to vc-sccs.el.
(with-vc-properties): New macro.
(vc-checkin, vc-checkout, vc-revert, vc-cancel-version,
vc-finish-steal): Use it.
(vc-cancel-version): Moved RCS-specific code to vc-rcs.el. The call
to the backend-specific function is now supposed to do the checkout,
too.
(vc-log-edit): Handle FILE being nil and added a FIXME for log-edit.
* vc-cvs.el (vc-cvs-checkin, vc-cvs-checkout): Don't bother to
set file properties; that gets done in the generic code now.
* vc-rcs.el (vc-rcs-uncheck): Renamed to `vc-rcs-cancel-version'.
Changed parameter list, added code from vc.el that does the
checkout, possibly with a double-take.
* vc-sccs.el (vc-sccs-name-assoc-file): Moved here from vc.el.
(vc-sccs-add-triple, vc-sccs-rename-file, vc-sccs-lookup-triple): Use
the above under the new name.
(vc-sccs-uncheck): Renamed to `vc-sccs-cancel-version'. Changed
parameter list, added checkout command.
(vc-sccs-checkin, vc-sccs-checkout): Don't bother to set file
properties; that gets done in the generic code now.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: Docstring fixes (courtesy of checkdoc).
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-checkout-writable-buffer-hook)
(vc-checkout-writable-buffer): Remove.
(vc-start-entry): Always call vc-log-edit, never vc-log-mode.
(vc-log-mode): Make it into a clean derived major mode.
(vc-log-edit): Mark buffer unmodified (as vc-log-mode did) and use
vc-log-mode if log-edit is not available.
(vc-dired-mode-map): Don't set-keymap-parent yet.
(vc-dired-mode): Do set-keymap-parent here.
(vc-dired-buffers-for-dir): Nop if dired is not loaded.
2000-09-05 20:08:22 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
(defun vc-cvs-dired-state-info (file)
|
|
|
|
"CVS-specific version of `vc-dired-state-info'."
|
2003-05-08 18:23:53 +00:00
|
|
|
(let ((cvs-state (vc-state file)))
|
|
|
|
(cond ((eq cvs-state 'edited)
|
2007-10-10 18:52:45 +00:00
|
|
|
(if (equal (vc-working-revision file) "0")
|
2003-05-08 18:23:53 +00:00
|
|
|
"(added)" "(modified)"))
|
2007-12-28 16:24:31 +00:00
|
|
|
(t
|
|
|
|
(vc-default-dired-state-info 'CVS file)))))
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; State-changing functions
|
|
|
|
;;;
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2007-07-18 16:32:40 +00:00
|
|
|
(defun vc-cvs-register (files &optional rev comment)
|
|
|
|
"Register FILES into the CVS version-control system.
|
|
|
|
COMMENT can be used to provide an initial description of FILES.
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
`vc-register-switches' and `vc-cvs-register-switches' are passed to
|
|
|
|
the CVS command (in that order)."
|
2008-02-24 22:54:30 +00:00
|
|
|
;; Register the directories if needed.
|
|
|
|
(let (dirs)
|
|
|
|
(dolist (file files)
|
|
|
|
(and (not (vc-cvs-responsible-p file))
|
|
|
|
(vc-cvs-could-register file)
|
|
|
|
(push (directory-file-name (file-name-directory file)) dirs)))
|
|
|
|
(if dirs (vc-cvs-register dirs)))
|
|
|
|
(apply 'vc-cvs-command nil 0 files
|
|
|
|
"add"
|
|
|
|
(and comment (string-match "[^\t\n ]" comment)
|
|
|
|
(concat "-m" comment))
|
|
|
|
(vc-switches 'CVS 'register)))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
(defun vc-cvs-responsible-p (file)
|
|
|
|
"Return non-nil if CVS thinks it is responsible for FILE."
|
|
|
|
(file-directory-p (expand-file-name "CVS"
|
|
|
|
(if (file-directory-p file)
|
|
|
|
file
|
|
|
|
(file-name-directory file)))))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2003-07-04 22:40:26 +00:00
|
|
|
(defun vc-cvs-could-register (file)
|
2000-11-16 18:14:41 +00:00
|
|
|
"Return non-nil if FILE could be registered in CVS.
|
2003-07-04 22:40:26 +00:00
|
|
|
This is only possible if CVS is managing FILE's directory or one of
|
|
|
|
its parents."
|
|
|
|
(let ((dir file))
|
|
|
|
(while (and (stringp dir)
|
|
|
|
(not (equal dir (setq dir (file-name-directory dir))))
|
|
|
|
dir)
|
|
|
|
(setq dir (if (file-directory-p
|
|
|
|
(expand-file-name "CVS/Entries" dir))
|
|
|
|
t (directory-file-name dir))))
|
|
|
|
(eq dir t)))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2007-07-18 16:32:40 +00:00
|
|
|
(defun vc-cvs-checkin (files rev comment)
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
"CVS-specific version of `vc-backend-checkin'."
|
2007-10-10 18:52:45 +00:00
|
|
|
(unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
|
2003-05-08 20:44:50 +00:00
|
|
|
(if (not (vc-cvs-valid-symbolic-tag-name-p rev))
|
|
|
|
(error "%s is not a valid symbolic tag name" rev)
|
|
|
|
;; If the input revison is a valid symbolic tag name, we create it
|
|
|
|
;; as a branch, commit and switch to it.
|
2007-07-18 16:32:40 +00:00
|
|
|
(apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev))
|
|
|
|
(apply 'vc-cvs-command nil 0 files "update" "-r" (list rev))
|
2007-07-19 14:18:33 +00:00
|
|
|
(mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev))
|
|
|
|
files)))
|
|
|
|
(let ((status (apply 'vc-cvs-command nil 1 files
|
2003-05-08 20:44:50 +00:00
|
|
|
"ci" (if rev (concat "-r" rev))
|
|
|
|
(concat "-m" comment)
|
|
|
|
(vc-switches 'CVS 'checkin))))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(set-buffer "*vc*")
|
|
|
|
(goto-char (point-min))
|
2000-10-27 11:37:17 +00:00
|
|
|
(when (not (zerop status))
|
|
|
|
;; Check checkin problem.
|
|
|
|
(cond
|
|
|
|
((re-search-forward "Up-to-date check failed" nil t)
|
2007-07-19 14:26:08 +00:00
|
|
|
(mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge))
|
|
|
|
files)
|
2007-12-06 17:56:42 +00:00
|
|
|
(error "%s" (substitute-command-keys
|
2000-10-27 11:37:17 +00:00
|
|
|
(concat "Up-to-date check failed: "
|
|
|
|
"type \\[vc-next-action] to merge in changes"))))
|
|
|
|
(t
|
|
|
|
(pop-to-buffer (current-buffer))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(shrink-window-if-larger-than-buffer)
|
|
|
|
(error "Check-in failed"))))
|
2007-10-10 18:52:45 +00:00
|
|
|
;; Single-file commit? Then update the revision by parsing the buffer.
|
2007-07-18 16:32:40 +00:00
|
|
|
;; Otherwise we can't necessarily tell what goes with what; clear
|
|
|
|
;; its properties so they have to be refetched.
|
|
|
|
(if (= (length files) 1)
|
|
|
|
(vc-file-setprop
|
2007-10-10 18:52:45 +00:00
|
|
|
(car files) 'vc-working-revision
|
2007-07-18 16:32:40 +00:00
|
|
|
(vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
|
|
|
|
(mapc (lambda (file) (vc-file-clearprops file)) files))
|
|
|
|
;; Anyway, forget the checkout model of the file, because we might have
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
;; guessed wrong when we found the file. After commit, we can
|
|
|
|
;; tell it from the permissions of the file (see
|
|
|
|
;; vc-cvs-checkout-model).
|
2007-07-18 16:32:40 +00:00
|
|
|
(mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil))
|
|
|
|
files)
|
2002-02-21 20:16:47 +00:00
|
|
|
|
|
|
|
;; if this was an explicit check-in (does not include creation of
|
|
|
|
;; a branch), remove the sticky tag.
|
|
|
|
(if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
|
2007-07-18 16:32:40 +00:00
|
|
|
(vc-cvs-command nil 0 files "update" "-A"))))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2007-10-10 18:52:45 +00:00
|
|
|
(defun vc-cvs-find-revision (file rev buffer)
|
2002-10-08 15:38:28 +00:00
|
|
|
(apply 'vc-cvs-command
|
|
|
|
buffer 0 file
|
|
|
|
"-Q" ; suppress diagnostic output
|
|
|
|
"update"
|
|
|
|
(and rev (not (string= rev ""))
|
|
|
|
(concat "-r" rev))
|
|
|
|
"-p"
|
2003-05-08 20:44:50 +00:00
|
|
|
(vc-switches 'CVS 'checkout)))
|
2002-10-08 15:38:28 +00:00
|
|
|
|
2007-07-08 19:34:19 +00:00
|
|
|
(defun vc-cvs-checkout (file &optional editable rev)
|
|
|
|
"Checkout a revision of FILE into the working area.
|
2001-01-08 16:24:56 +00:00
|
|
|
EDITABLE non-nil means that the file should be writable.
|
2007-07-08 19:34:19 +00:00
|
|
|
REV is the revision to check out."
|
|
|
|
(message "Checking out %s..." file)
|
|
|
|
;; Change buffers to get local value of vc-checkout-switches.
|
|
|
|
(with-current-buffer (or (get-file-buffer file) (current-buffer))
|
|
|
|
(if (and (file-exists-p file) (not rev))
|
|
|
|
;; If no revision was specified, just make the file writable
|
|
|
|
;; if necessary (using `cvs-edit' if requested).
|
|
|
|
(and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
|
|
|
|
(if vc-cvs-use-edit
|
|
|
|
(vc-cvs-command nil 0 file "edit")
|
|
|
|
(set-file-modes file (logior (file-modes file) 128))
|
|
|
|
(if (equal file buffer-file-name) (toggle-read-only -1))))
|
2007-10-10 18:52:45 +00:00
|
|
|
;; Check out a particular revision (or recreate the file).
|
|
|
|
(vc-file-setprop file 'vc-working-revision nil)
|
2007-07-08 19:34:19 +00:00
|
|
|
(apply 'vc-cvs-command nil 0 file
|
|
|
|
(and editable "-w")
|
|
|
|
"update"
|
|
|
|
(when rev
|
|
|
|
(unless (eq rev t)
|
|
|
|
;; default for verbose checkout: clear the
|
|
|
|
;; sticky tag so that the actual update will
|
|
|
|
;; get the head of the trunk
|
|
|
|
(if (string= rev "")
|
|
|
|
"-A"
|
|
|
|
(concat "-r" rev))))
|
|
|
|
(vc-switches 'CVS 'checkout)))
|
|
|
|
(vc-mode-line file))
|
|
|
|
(message "Checking out %s...done" file))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2003-05-09 14:32:01 +00:00
|
|
|
(defun vc-cvs-delete-file (file)
|
2005-10-30 11:08:41 +00:00
|
|
|
(vc-cvs-command nil 0 file "remove" "-f")
|
|
|
|
(vc-cvs-command nil 0 file "commit" "-mRemoved."))
|
2003-05-09 14:32:01 +00:00
|
|
|
|
2001-08-28 17:06:36 +00:00
|
|
|
(defun vc-cvs-revert (file &optional contents-done)
|
2007-10-10 18:52:45 +00:00
|
|
|
"Revert FILE to the working revision on which it was based."
|
2007-07-08 19:34:19 +00:00
|
|
|
(vc-default-revert 'CVS file contents-done)
|
2001-08-28 17:06:36 +00:00
|
|
|
(unless (eq (vc-checkout-model file) 'implicit)
|
|
|
|
(if vc-cvs-use-edit
|
2002-03-28 14:29:06 +00:00
|
|
|
(vc-cvs-command nil 0 file "unedit")
|
2001-08-28 17:06:36 +00:00
|
|
|
;; Make the file read-only by switching off all w-bits
|
|
|
|
(set-file-modes file (logand (file-modes file) 3950)))))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
2007-10-10 18:52:45 +00:00
|
|
|
(defun vc-cvs-merge (file first-revision &optional second-revision)
|
2000-11-16 18:14:41 +00:00
|
|
|
"Merge changes into current working copy of FILE.
|
2007-10-10 18:52:45 +00:00
|
|
|
The changes are between FIRST-REVISION and SECOND-REVISION."
|
2002-03-28 14:29:06 +00:00
|
|
|
(vc-cvs-command nil 0 file
|
2000-11-16 18:14:41 +00:00
|
|
|
"update" "-kk"
|
2007-10-10 18:52:45 +00:00
|
|
|
(concat "-j" first-revision)
|
|
|
|
(concat "-j" second-revision))
|
2000-11-16 18:14:41 +00:00
|
|
|
(vc-file-setprop file 'vc-state 'edited)
|
2003-04-19 22:40:18 +00:00
|
|
|
(with-current-buffer (get-buffer "*vc*")
|
2000-11-16 18:14:41 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(if (re-search-forward "conflicts during merge" nil t)
|
|
|
|
1 ; signal error
|
|
|
|
0))) ; signal success
|
|
|
|
|
|
|
|
(defun vc-cvs-merge-news (file)
|
|
|
|
"Merge in any new changes made to FILE."
|
|
|
|
(message "Merging changes into %s..." file)
|
2007-10-10 18:52:45 +00:00
|
|
|
;; (vc-file-setprop file 'vc-working-revision nil)
|
2003-04-19 22:40:18 +00:00
|
|
|
(vc-file-setprop file 'vc-checkout-time 0)
|
2008-01-13 20:03:35 +00:00
|
|
|
(vc-cvs-command nil nil file "update")
|
2003-04-19 22:40:18 +00:00
|
|
|
;; Analyze the merge result reported by CVS, and set
|
|
|
|
;; file properties accordingly.
|
|
|
|
(with-current-buffer (get-buffer "*vc*")
|
2000-11-16 18:14:41 +00:00
|
|
|
(goto-char (point-min))
|
2007-10-10 18:52:45 +00:00
|
|
|
;; get new working revision
|
2003-04-19 22:40:18 +00:00
|
|
|
(if (re-search-forward
|
|
|
|
"^Merging differences between [0-9.]* and \\([0-9.]*\\) into" nil t)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-working-revision (match-string 1))
|
|
|
|
(vc-file-setprop file 'vc-working-revision nil))
|
2000-11-16 18:14:41 +00:00
|
|
|
;; get file status
|
|
|
|
(prog1
|
|
|
|
(if (eq (buffer-size) 0)
|
|
|
|
0 ;; there were no news; indicate success
|
|
|
|
(if (re-search-forward
|
|
|
|
(concat "^\\([CMUP] \\)?"
|
|
|
|
(regexp-quote (file-name-nondirectory file))
|
|
|
|
"\\( already contains the differences between \\)?")
|
|
|
|
nil t)
|
|
|
|
(cond
|
|
|
|
;; Merge successful, we are in sync with repository now
|
|
|
|
((or (match-string 2)
|
|
|
|
(string= (match-string 1) "U ")
|
|
|
|
(string= (match-string 1) "P "))
|
|
|
|
(vc-file-setprop file 'vc-state 'up-to-date)
|
|
|
|
(vc-file-setprop file 'vc-checkout-time
|
|
|
|
(nth 5 (file-attributes file)))
|
|
|
|
0);; indicate success to the caller
|
|
|
|
;; Merge successful, but our own changes are still in the file
|
|
|
|
((string= (match-string 1) "M ")
|
|
|
|
(vc-file-setprop file 'vc-state 'edited)
|
|
|
|
0);; indicate success to the caller
|
|
|
|
;; Conflicts detected!
|
|
|
|
(t
|
|
|
|
(vc-file-setprop file 'vc-state 'edited)
|
|
|
|
1);; signal the error to the caller
|
|
|
|
)
|
|
|
|
(pop-to-buffer "*vc*")
|
|
|
|
(error "Couldn't analyze cvs update result")))
|
|
|
|
(message "Merging changes into %s...done" file))))
|
|
|
|
|
2007-12-27 11:26:27 +00:00
|
|
|
(defun vc-cvs-modify-change-comment (files rev comment)
|
|
|
|
"Modify the change comments for FILES on a specified REV.
|
|
|
|
Will fail unless you have administrative privileges on the repo."
|
|
|
|
(vc-cvs-command nil 0 files "rcs" (concat "-m" comment ":" rev)))
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; History functions
|
|
|
|
;;;
|
|
|
|
|
2007-07-18 16:32:40 +00:00
|
|
|
(defun vc-cvs-print-log (files &optional buffer)
|
2007-12-27 03:17:24 +00:00
|
|
|
"Get change logs associated with FILES."
|
|
|
|
;; It's just the catenation of the individual logs.
|
2002-03-28 14:29:06 +00:00
|
|
|
(vc-cvs-command
|
2004-03-21 15:45:31 +00:00
|
|
|
buffer
|
2007-11-10 05:22:16 +00:00
|
|
|
(if (vc-stay-local-p files) 'async 0)
|
2007-07-18 16:32:40 +00:00
|
|
|
files "log"))
|
|
|
|
|
|
|
|
(defun vc-cvs-wash-log ()
|
|
|
|
"Remove all non-comment information from log output."
|
|
|
|
(vc-call-backend 'RCS 'wash-log)
|
|
|
|
nil)
|
2000-11-16 18:14:41 +00:00
|
|
|
|
2007-07-18 16:32:40 +00:00
|
|
|
(defun vc-cvs-diff (files &optional oldvers newvers buffer)
|
2007-10-10 18:52:45 +00:00
|
|
|
"Get a difference report using CVS between two revisions of FILE."
|
2007-11-12 03:56:38 +00:00
|
|
|
(let* ((async (and (not vc-disable-async-diff)
|
|
|
|
(vc-stay-local-p files)))
|
|
|
|
(invoke-cvs-diff-list nil)
|
|
|
|
status)
|
|
|
|
;; Look through the file list and see if any files have backups
|
|
|
|
;; that can be used to do a plain "diff" instead of "cvs diff".
|
|
|
|
(dolist (file files)
|
|
|
|
(let ((ov oldvers)
|
|
|
|
(nv newvers))
|
|
|
|
(when (or (not ov) (string-equal ov ""))
|
|
|
|
(setq ov (vc-working-revision file)))
|
|
|
|
(when (string-equal nv "")
|
|
|
|
(setq nv nil))
|
|
|
|
(let ((file-oldvers (vc-version-backup-file file ov))
|
|
|
|
(file-newvers (if (not nv)
|
|
|
|
file
|
|
|
|
(vc-version-backup-file file nv)))
|
|
|
|
(coding-system-for-read (vc-coding-system-for-diff file)))
|
|
|
|
(if (and file-oldvers file-newvers)
|
|
|
|
(progn
|
|
|
|
(apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil
|
|
|
|
(append (if (listp diff-switches)
|
|
|
|
diff-switches
|
|
|
|
(list diff-switches))
|
|
|
|
(if (listp vc-diff-switches)
|
|
|
|
vc-diff-switches
|
|
|
|
(list vc-diff-switches))
|
|
|
|
(list (file-relative-name file-oldvers)
|
|
|
|
(file-relative-name file-newvers))))
|
|
|
|
(setq status 0))
|
|
|
|
(push file invoke-cvs-diff-list)))))
|
|
|
|
(when invoke-cvs-diff-list
|
|
|
|
(setq status (apply 'vc-cvs-command (or buffer "*vc-diff*")
|
2003-05-08 20:44:50 +00:00
|
|
|
(if async 'async 1)
|
2007-11-12 03:56:38 +00:00
|
|
|
invoke-cvs-diff-list "diff"
|
2003-05-08 20:44:50 +00:00
|
|
|
(and oldvers (concat "-r" oldvers))
|
|
|
|
(and newvers (concat "-r" newvers))
|
|
|
|
(vc-switches 'CVS 'diff))))
|
2007-11-12 03:56:38 +00:00
|
|
|
(if async 1 status))) ; async diff, pessimistic assumption
|
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
|
2001-10-21 12:21:29 +00:00
|
|
|
(defun vc-cvs-diff-tree (dir &optional rev1 rev2)
|
|
|
|
"Diff all files at and below DIR."
|
|
|
|
(with-current-buffer "*vc-diff*"
|
|
|
|
(setq default-directory dir)
|
2003-07-04 22:40:26 +00:00
|
|
|
(if (vc-stay-local-p dir)
|
2001-10-21 12:21:29 +00:00
|
|
|
;; local diff: do it filewise, and only for files that are modified
|
|
|
|
(vc-file-tree-walk
|
|
|
|
dir
|
|
|
|
(lambda (f)
|
|
|
|
(vc-exec-after
|
|
|
|
`(let ((coding-system-for-read (vc-coding-system-for-diff ',f)))
|
|
|
|
;; possible optimization: fetch the state of all files
|
|
|
|
;; in the tree via vc-cvs-dir-state-heuristic
|
|
|
|
(unless (vc-up-to-date-p ',f)
|
|
|
|
(message "Looking at %s" ',f)
|
2002-03-05 13:30:50 +00:00
|
|
|
(vc-diff-internal ',f ',rev1 ',rev2))))))
|
2001-10-21 12:21:29 +00:00
|
|
|
;; cvs diff: use a single call for the entire tree
|
|
|
|
(let ((coding-system-for-read
|
|
|
|
(or coding-system-for-read 'undecided)))
|
2002-03-28 14:29:06 +00:00
|
|
|
(apply 'vc-cvs-command "*vc-diff*" 1 nil "diff"
|
2002-03-05 13:30:50 +00:00
|
|
|
(and rev1 (concat "-r" rev1))
|
|
|
|
(and rev2 (concat "-r" rev2))
|
2003-05-08 20:44:50 +00:00
|
|
|
(vc-switches 'CVS 'diff))))))
|
2001-10-21 12:21:29 +00:00
|
|
|
|
2007-07-12 03:10:45 +00:00
|
|
|
(defconst vc-cvs-annotate-first-line-re "^[0-9]")
|
|
|
|
|
|
|
|
(defun vc-cvs-annotate-process-filter (process string)
|
|
|
|
(setq string (concat (process-get process 'output) string))
|
|
|
|
(if (not (string-match vc-cvs-annotate-first-line-re string))
|
|
|
|
;; Still waiting for the first real line.
|
|
|
|
(process-put process 'output string)
|
|
|
|
(let ((vc-filter (process-get process 'vc-filter)))
|
|
|
|
(set-process-filter process vc-filter)
|
|
|
|
(funcall vc-filter process (substring string (match-beginning 0))))))
|
|
|
|
|
2007-10-10 18:52:45 +00:00
|
|
|
(defun vc-cvs-annotate-command (file buffer &optional revision)
|
2000-11-16 18:14:41 +00:00
|
|
|
"Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
|
2007-10-10 18:52:45 +00:00
|
|
|
Optional arg REVISION is a revision to annotate from."
|
2007-07-12 03:10:45 +00:00
|
|
|
(vc-cvs-command buffer
|
2007-11-10 05:22:16 +00:00
|
|
|
(if (vc-stay-local-p file)
|
2007-07-12 03:10:45 +00:00
|
|
|
'async 0)
|
|
|
|
file "annotate"
|
2007-10-10 18:52:45 +00:00
|
|
|
(if revision (concat "-r" revision)))
|
2007-07-12 03:10:45 +00:00
|
|
|
;; Strip the leading few lines.
|
|
|
|
(let ((proc (get-buffer-process buffer)))
|
|
|
|
(if proc
|
|
|
|
;; If running asynchronously, use a process filter.
|
|
|
|
(progn
|
|
|
|
(process-put proc 'vc-filter (process-filter proc))
|
|
|
|
(set-process-filter proc 'vc-cvs-annotate-process-filter))
|
|
|
|
(with-current-buffer buffer
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward vc-cvs-annotate-first-line-re)
|
|
|
|
(delete-region (point-min) (1- (point)))))))
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
|
2001-10-22 07:57:00 +00:00
|
|
|
(defun vc-cvs-annotate-current-time ()
|
|
|
|
"Return the current time, based at midnight of the current day, and
|
|
|
|
encoded as fractional days."
|
|
|
|
(vc-annotate-convert-time
|
|
|
|
(apply 'encode-time 0 0 0 (nthcdr 3 (decode-time (current-time))))))
|
|
|
|
|
|
|
|
(defun vc-cvs-annotate-time ()
|
|
|
|
"Return the time of the next annotation (as fraction of days)
|
2001-12-20 19:01:00 +00:00
|
|
|
systime, or nil if there is none."
|
2004-11-03 14:28:31 +00:00
|
|
|
(let* ((bol (point))
|
|
|
|
(cache (get-text-property bol 'vc-cvs-annotate-time))
|
2007-09-15 21:07:32 +00:00
|
|
|
(inhibit-read-only t)
|
|
|
|
(inhibit-modification-hooks t))
|
2004-11-03 14:28:31 +00:00
|
|
|
(cond
|
|
|
|
(cache)
|
|
|
|
((looking-at
|
|
|
|
"^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ")
|
|
|
|
(let ((day (string-to-number (match-string 1)))
|
|
|
|
(month (cdr (assq (intern (match-string 2))
|
|
|
|
'((Jan . 1) (Feb . 2) (Mar . 3)
|
|
|
|
(Apr . 4) (May . 5) (Jun . 6)
|
|
|
|
(Jul . 7) (Aug . 8) (Sep . 9)
|
|
|
|
(Oct . 10) (Nov . 11) (Dec . 12)))))
|
|
|
|
(year (let ((tmp (string-to-number (match-string 3))))
|
|
|
|
;; Years 0..68 are 2000..2068.
|
|
|
|
;; Years 69..99 are 1969..1999.
|
|
|
|
(+ (cond ((> 69 tmp) 2000)
|
|
|
|
((> 100 tmp) 1900)
|
|
|
|
(t 0))
|
|
|
|
tmp))))
|
|
|
|
(put-text-property
|
|
|
|
bol (1+ bol) 'vc-cvs-annotate-time
|
|
|
|
(setq cache (cons
|
|
|
|
;; Position at end makes for nicer overlay result.
|
2008-01-05 05:19:00 +00:00
|
|
|
;; Don't put actual buffer pos here, but only relative
|
|
|
|
;; distance, so we don't ever move backward in the
|
|
|
|
;; goto-char below, even if the text is moved.
|
|
|
|
(- (match-end 0) (match-beginning 0))
|
2004-11-03 14:28:31 +00:00
|
|
|
(vc-annotate-convert-time
|
|
|
|
(encode-time 0 0 0 day month year))))))))
|
|
|
|
(when cache
|
2008-01-05 05:19:00 +00:00
|
|
|
(goto-char (+ bol (car cache))) ; Fontify from here to eol.
|
2004-11-03 14:28:31 +00:00
|
|
|
(cdr cache)))) ; days (float)
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2004-01-20 17:41:18 +00:00
|
|
|
(defun vc-cvs-annotate-extract-revision-at-line ()
|
|
|
|
(save-excursion
|
|
|
|
(beginning-of-line)
|
|
|
|
(if (re-search-forward "^\\([0-9]+\\.[0-9]+\\(\\.[0-9]+\\)*\\) +("
|
|
|
|
(line-end-position) t)
|
|
|
|
(match-string-no-properties 1)
|
|
|
|
nil)))
|
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; Snapshot system
|
|
|
|
;;;
|
|
|
|
|
|
|
|
(defun vc-cvs-create-snapshot (dir name branchp)
|
2007-10-10 18:52:45 +00:00
|
|
|
"Assign to DIR's current revision a given NAME.
|
2000-11-16 18:14:41 +00:00
|
|
|
If BRANCHP is non-nil, the name is created as a branch (and the current
|
|
|
|
workspace is immediately moved to that new branch)."
|
2002-03-28 14:29:06 +00:00
|
|
|
(vc-cvs-command nil 0 dir "tag" "-c" (if branchp "-b") name)
|
|
|
|
(when branchp (vc-cvs-command nil 0 dir "update" "-r" name)))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-retrieve-snapshot (dir name update)
|
|
|
|
"Retrieve a snapshot at and below DIR.
|
|
|
|
NAME is the name of the snapshot; if it is empty, do a `cvs update'.
|
|
|
|
If UPDATE is non-nil, then update (resynch) any affected buffers."
|
|
|
|
(with-current-buffer (get-buffer-create "*vc*")
|
2002-02-21 20:16:47 +00:00
|
|
|
(let ((default-directory dir)
|
|
|
|
(sticky-tag))
|
2000-11-16 18:14:41 +00:00
|
|
|
(erase-buffer)
|
|
|
|
(if (or (not name) (string= name ""))
|
2002-03-28 14:29:06 +00:00
|
|
|
(vc-cvs-command t 0 nil "update")
|
|
|
|
(vc-cvs-command t 0 nil "update" "-r" name)
|
2002-02-21 20:16:47 +00:00
|
|
|
(setq sticky-tag name))
|
2000-11-16 18:14:41 +00:00
|
|
|
(when update
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (not (eobp))
|
|
|
|
(if (looking-at "\\([CMUP]\\) \\(.*\\)")
|
|
|
|
(let* ((file (expand-file-name (match-string 2) dir))
|
|
|
|
(state (match-string 1))
|
|
|
|
(buffer (find-buffer-visiting file)))
|
|
|
|
(when buffer
|
|
|
|
(cond
|
|
|
|
((or (string= state "U")
|
|
|
|
(string= state "P"))
|
|
|
|
(vc-file-setprop file 'vc-state 'up-to-date)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-working-revision nil)
|
2000-11-16 18:14:41 +00:00
|
|
|
(vc-file-setprop file 'vc-checkout-time
|
|
|
|
(nth 5 (file-attributes file))))
|
|
|
|
((or (string= state "M")
|
|
|
|
(string= state "C"))
|
|
|
|
(vc-file-setprop file 'vc-state 'edited)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-working-revision nil)
|
2000-11-16 18:14:41 +00:00
|
|
|
(vc-file-setprop file 'vc-checkout-time 0)))
|
2002-02-21 20:16:47 +00:00
|
|
|
(vc-file-setprop file 'vc-cvs-sticky-tag sticky-tag)
|
2000-11-16 18:14:41 +00:00
|
|
|
(vc-resynch-buffer file t t))))
|
|
|
|
(forward-line 1))))))
|
|
|
|
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; Miscellaneous
|
|
|
|
;;;
|
|
|
|
|
2003-07-04 22:40:26 +00:00
|
|
|
(defalias 'vc-cvs-make-version-backups-p 'vc-stay-local-p
|
2003-04-19 22:40:18 +00:00
|
|
|
"Return non-nil if version backups should be made for FILE.")
|
2000-11-16 18:14:41 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-check-headers ()
|
|
|
|
"Check if the current file has any headers in it."
|
|
|
|
(save-excursion
|
|
|
|
(goto-char (point-min))
|
|
|
|
(re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\
|
|
|
|
\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
|
|
|
|
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; Internal functions
|
|
|
|
;;;
|
|
|
|
|
2008-02-19 11:45:54 +00:00
|
|
|
(defun vc-cvs-root (dir)
|
|
|
|
(vc-find-root dir "CVS" t))
|
|
|
|
|
2007-07-18 16:32:40 +00:00
|
|
|
(defun vc-cvs-command (buffer okstatus files &rest flags)
|
2002-03-28 14:29:06 +00:00
|
|
|
"A wrapper around `vc-do-command' for use in vc-cvs.el.
|
|
|
|
The difference to vc-do-command is that this function always invokes `cvs',
|
|
|
|
and that it passes `vc-cvs-global-switches' to it before FLAGS."
|
2007-07-18 16:32:40 +00:00
|
|
|
(apply 'vc-do-command buffer okstatus "cvs" files
|
2002-04-08 13:38:48 +00:00
|
|
|
(if (stringp vc-cvs-global-switches)
|
2002-03-28 14:29:06 +00:00
|
|
|
(cons vc-cvs-global-switches flags)
|
|
|
|
(append vc-cvs-global-switches
|
|
|
|
flags))))
|
|
|
|
|
2003-07-04 22:40:26 +00:00
|
|
|
(defalias 'vc-cvs-stay-local-p 'vc-stay-local-p) ;Back-compatibility.
|
|
|
|
|
|
|
|
(defun vc-cvs-repository-hostname (dirname)
|
|
|
|
"Hostname of the CVS server associated to workarea DIRNAME."
|
|
|
|
(let ((rootname (expand-file-name "CVS/Root" dirname)))
|
|
|
|
(when (file-readable-p rootname)
|
|
|
|
(with-temp-buffer
|
|
|
|
(let ((coding-system-for-read
|
|
|
|
(or file-name-coding-system
|
|
|
|
default-file-name-coding-system)))
|
|
|
|
(vc-insert-file rootname))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(nth 2 (vc-cvs-parse-root
|
|
|
|
(buffer-substring (point)
|
|
|
|
(line-end-position))))))))
|
2003-05-08 18:23:53 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-parse-root (root)
|
2003-04-23 12:49:25 +00:00
|
|
|
"Split CVS ROOT specification string into a list of fields.
|
|
|
|
A CVS root specification of the form
|
|
|
|
[:METHOD:][[USER@]HOSTNAME:]/path/to/repository
|
|
|
|
is converted to a normalized record with the following structure:
|
|
|
|
\(METHOD USER HOSTNAME CVS-ROOT).
|
|
|
|
The default METHOD for a CVS root of the form
|
|
|
|
/path/to/repository
|
|
|
|
is `local'.
|
|
|
|
The default METHOD for a CVS root of the form
|
|
|
|
[USER@]HOSTNAME:/path/to/repository
|
|
|
|
is `ext'.
|
2005-03-25 08:25:16 +00:00
|
|
|
For an empty string, nil is returned (invalid CVS root)."
|
2003-04-23 12:49:25 +00:00
|
|
|
;; Split CVS root into colon separated fields (0-4).
|
|
|
|
;; The `x:' makes sure, that leading colons are not lost;
|
|
|
|
;; `HOST:/PATH' is then different from `:METHOD:/PATH'.
|
|
|
|
(let* ((root-list (cdr (split-string (concat "x:" root) ":")))
|
|
|
|
(len (length root-list))
|
|
|
|
;; All syntactic varieties will get a proper METHOD.
|
|
|
|
(root-list
|
|
|
|
(cond
|
|
|
|
((= len 0)
|
|
|
|
;; Invalid CVS root
|
|
|
|
nil)
|
|
|
|
((= len 1)
|
|
|
|
;; Simple PATH => method `local'
|
|
|
|
(cons "local"
|
|
|
|
(cons nil root-list)))
|
|
|
|
((= len 2)
|
|
|
|
;; [USER@]HOST:PATH => method `ext'
|
|
|
|
(and (not (equal (car root-list) ""))
|
|
|
|
(cons "ext" root-list)))
|
|
|
|
((= len 3)
|
|
|
|
;; :METHOD:PATH
|
|
|
|
(cons (cadr root-list)
|
|
|
|
(cons nil (cddr root-list))))
|
|
|
|
(t
|
|
|
|
;; :METHOD:[USER@]HOST:PATH
|
|
|
|
(cdr root-list)))))
|
|
|
|
(if root-list
|
|
|
|
(let ((method (car root-list))
|
|
|
|
(uhost (or (cadr root-list) ""))
|
|
|
|
(root (nth 2 root-list))
|
|
|
|
user host)
|
|
|
|
;; Split USER@HOST
|
|
|
|
(if (string-match "\\(.*\\)@\\(.*\\)" uhost)
|
|
|
|
(setq user (match-string 1 uhost)
|
|
|
|
host (match-string 2 uhost))
|
|
|
|
(setq host uhost))
|
|
|
|
;; Remove empty HOST
|
|
|
|
(and (equal host "")
|
|
|
|
(setq host))
|
|
|
|
;; Fix windows style CVS root `:local:C:\\project\\cvs\\some\\dir'
|
|
|
|
(and host
|
|
|
|
(equal method "local")
|
|
|
|
(setq root (concat host ":" root) host))
|
|
|
|
;; Normalize CVS root record
|
|
|
|
(list method user host root)))))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-parse-status (&optional full)
|
|
|
|
"Parse output of \"cvs status\" command in the current buffer.
|
|
|
|
Set file properties accordingly. Unless FULL is t, parse only
|
2007-12-28 18:16:55 +00:00
|
|
|
essential information. Note that this can never set the 'ignored
|
|
|
|
state."
|
2000-11-16 18:14:41 +00:00
|
|
|
(let (file status)
|
|
|
|
(goto-char (point-min))
|
2007-12-28 18:16:55 +00:00
|
|
|
(while (looking-at "? \\(.*\\)")
|
|
|
|
(setq file (expand-file-name (match-string 1)))
|
|
|
|
(vc-file-setprop file 'vc-state 'unregistered)
|
|
|
|
(forward-line 1))
|
2000-11-16 18:14:41 +00:00
|
|
|
(if (re-search-forward "^File: " nil t)
|
|
|
|
(cond
|
|
|
|
((looking-at "no file") nil)
|
|
|
|
((re-search-forward "\\=\\([^ \t]+\\)" nil t)
|
|
|
|
(setq file (expand-file-name (match-string 1)))
|
|
|
|
(vc-file-setprop file 'vc-backend 'CVS)
|
|
|
|
(if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t))
|
|
|
|
(setq status "Unknown")
|
|
|
|
(setq status (match-string 1)))
|
|
|
|
(if (and full
|
|
|
|
(re-search-forward
|
2001-11-30 13:47:39 +00:00
|
|
|
"\\(RCS Version\\|RCS Revision\\|Repository revision\\):\
|
2000-11-16 18:14:41 +00:00
|
|
|
\[\t ]+\\([0-9.]+\\)"
|
|
|
|
nil t))
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-latest-revision (match-string 2)))
|
2002-04-08 13:38:48 +00:00
|
|
|
(vc-file-setprop
|
2001-11-30 13:47:39 +00:00
|
|
|
file 'vc-state
|
|
|
|
(cond
|
|
|
|
((string-match "Up-to-date" status)
|
|
|
|
(vc-file-setprop file 'vc-checkout-time
|
|
|
|
(nth 5 (file-attributes file)))
|
|
|
|
'up-to-date)
|
|
|
|
((string-match "Locally Modified" status) 'edited)
|
|
|
|
((string-match "Needs Merge" status) 'needs-merge)
|
|
|
|
((string-match "Needs \\(Checkout\\|Patch\\)" status) 'needs-patch)
|
|
|
|
(t 'edited))))))))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-dir-state-heuristic (dir)
|
|
|
|
"Find the CVS state of all files in DIR, using only local information."
|
|
|
|
(with-temp-buffer
|
2003-04-05 15:51:14 +00:00
|
|
|
(vc-cvs-get-entries dir)
|
2000-11-16 18:14:41 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(while (not (eobp))
|
2002-03-22 23:10:01 +00:00
|
|
|
;; CVS-removed files are not taken under VC control.
|
|
|
|
(when (looking-at "/\\([^/]*\\)/[^/-]")
|
2000-11-16 18:14:41 +00:00
|
|
|
(let ((file (expand-file-name (match-string 1) dir)))
|
|
|
|
(unless (vc-file-getprop file 'vc-state)
|
|
|
|
(vc-cvs-parse-entry file t))))
|
|
|
|
(forward-line 1))))
|
|
|
|
|
2003-04-05 15:51:14 +00:00
|
|
|
(defun vc-cvs-get-entries (dir)
|
|
|
|
"Insert the CVS/Entries file from below DIR into the current buffer.
|
|
|
|
This function ensures that the correct coding system is used for that,
|
|
|
|
which may not be the one that is used for the files' contents.
|
|
|
|
CVS/Entries should only be accessed through this function."
|
|
|
|
(let ((coding-system-for-read (or file-name-coding-system
|
|
|
|
default-file-name-coding-system)))
|
|
|
|
(vc-insert-file (expand-file-name "CVS/Entries" dir))))
|
2004-11-03 14:16:14 +00:00
|
|
|
|
2002-02-21 20:16:47 +00:00
|
|
|
(defun vc-cvs-valid-symbolic-tag-name-p (tag)
|
|
|
|
"Return non-nil if TAG is a valid symbolic tag name."
|
|
|
|
;; According to the CVS manual, a valid symbolic tag must start with
|
|
|
|
;; an uppercase or lowercase letter and can contain uppercase and
|
|
|
|
;; lowercase letters, digits, `-', and `_'.
|
|
|
|
(and (string-match "^[a-zA-Z]" tag)
|
|
|
|
(not (string-match "[^a-z0-9A-Z-_]" tag))))
|
2002-04-08 13:38:48 +00:00
|
|
|
|
2007-10-10 18:52:45 +00:00
|
|
|
(defun vc-cvs-valid-revision-number-p (tag)
|
|
|
|
"Return non-nil if TAG is a valid revision number."
|
2002-04-09 17:13:51 +00:00
|
|
|
(and (string-match "^[0-9]" tag)
|
|
|
|
(not (string-match "[^0-9.]" tag))))
|
2002-02-21 20:16:47 +00:00
|
|
|
|
|
|
|
(defun vc-cvs-parse-sticky-tag (match-type match-tag)
|
2002-04-08 13:38:48 +00:00
|
|
|
"Parse and return the sticky tag as a string.
|
2002-02-21 20:16:47 +00:00
|
|
|
`match-data' is protected."
|
|
|
|
(let ((data (match-data))
|
|
|
|
(tag)
|
|
|
|
(type (cond ((string= match-type "D") 'date)
|
|
|
|
((string= match-type "T")
|
|
|
|
(if (vc-cvs-valid-symbolic-tag-name-p match-tag)
|
|
|
|
'symbolic-name
|
|
|
|
'revision-number))
|
|
|
|
(t nil))))
|
|
|
|
(unwind-protect
|
|
|
|
(progn
|
2002-04-08 13:38:48 +00:00
|
|
|
(cond
|
2002-07-03 14:26:51 +00:00
|
|
|
;; Sticky Date tag. Convert to a proper date value (`encode-time')
|
2002-02-21 20:16:47 +00:00
|
|
|
((eq type 'date)
|
2002-04-08 13:38:48 +00:00
|
|
|
(string-match
|
|
|
|
"\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)"
|
2002-02-21 20:16:47 +00:00
|
|
|
match-tag)
|
|
|
|
(let* ((year-tmp (string-to-number (match-string 1 match-tag)))
|
|
|
|
(month (string-to-number (match-string 2 match-tag)))
|
|
|
|
(day (string-to-number (match-string 3 match-tag)))
|
|
|
|
(hour (string-to-number (match-string 4 match-tag)))
|
|
|
|
(min (string-to-number (match-string 5 match-tag)))
|
|
|
|
(sec (string-to-number (match-string 6 match-tag)))
|
|
|
|
;; Years 0..68 are 2000..2068.
|
|
|
|
;; Years 69..99 are 1969..1999.
|
|
|
|
(year (+ (cond ((> 69 year-tmp) 2000)
|
|
|
|
((> 100 year-tmp) 1900)
|
|
|
|
(t 0))
|
|
|
|
year-tmp)))
|
|
|
|
(setq tag (encode-time sec min hour day month year))))
|
|
|
|
;; Sticky Tag name or revision number
|
|
|
|
((eq type 'symbolic-name) (setq tag match-tag))
|
|
|
|
((eq type 'revision-number) (setq tag match-tag))
|
|
|
|
;; Default is no sticky tag at all
|
|
|
|
(t nil))
|
|
|
|
(cond ((eq vc-cvs-sticky-tag-display nil) nil)
|
|
|
|
((eq vc-cvs-sticky-tag-display t)
|
2002-04-08 13:38:48 +00:00
|
|
|
(cond ((eq type 'date) (format-time-string
|
2002-02-21 20:16:47 +00:00
|
|
|
vc-cvs-sticky-date-format-string
|
|
|
|
tag))
|
|
|
|
((eq type 'symbolic-name) tag)
|
|
|
|
((eq type 'revision-number) tag)
|
|
|
|
(t nil)))
|
2002-04-08 13:38:48 +00:00
|
|
|
((functionp vc-cvs-sticky-tag-display)
|
2002-02-21 20:16:47 +00:00
|
|
|
(funcall vc-cvs-sticky-tag-display tag type))
|
|
|
|
(t nil)))
|
|
|
|
|
|
|
|
(set-match-data data))))
|
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
(defun vc-cvs-parse-entry (file &optional set-state)
|
|
|
|
"Parse a line from CVS/Entries.
|
|
|
|
Compare modification time to that of the FILE, set file properties
|
|
|
|
accordingly. However, `vc-state' is set only if optional arg SET-STATE
|
|
|
|
is non-nil."
|
|
|
|
(cond
|
|
|
|
;; entry for a "locally added" file (not yet committed)
|
|
|
|
((looking-at "/[^/]+/0/")
|
2007-12-31 20:43:49 +00:00
|
|
|
(vc-file-setprop file 'vc-backend 'CVS)
|
2000-11-16 18:14:41 +00:00
|
|
|
(vc-file-setprop file 'vc-checkout-time 0)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-working-revision "0")
|
2000-11-16 18:14:41 +00:00
|
|
|
(if set-state (vc-file-setprop file 'vc-state 'edited)))
|
|
|
|
;; normal entry
|
|
|
|
((looking-at
|
|
|
|
(concat "/[^/]+"
|
|
|
|
;; revision
|
|
|
|
"/\\([^/]*\\)"
|
2003-03-27 22:40:29 +00:00
|
|
|
;; timestamp and optional conflict field
|
|
|
|
"/\\([^/]*\\)/"
|
2002-02-21 20:16:47 +00:00
|
|
|
;; options
|
|
|
|
"\\([^/]*\\)/"
|
|
|
|
;; sticky tag
|
|
|
|
"\\(.\\|\\)" ;Sticky tag type (date or tag name, could be empty)
|
|
|
|
"\\(.*\\)")) ;Sticky tag
|
2007-12-31 20:43:49 +00:00
|
|
|
(vc-file-setprop file 'vc-backend 'CVS)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-working-revision (match-string 1))
|
2002-03-22 23:10:01 +00:00
|
|
|
(vc-file-setprop file 'vc-cvs-sticky-tag
|
2004-11-03 14:16:14 +00:00
|
|
|
(vc-cvs-parse-sticky-tag (match-string 4)
|
2003-09-26 07:23:36 +00:00
|
|
|
(match-string 5)))
|
2003-09-24 11:55:45 +00:00
|
|
|
;; Compare checkout time and modification time.
|
|
|
|
;; This is intentionally different from the algorithm that CVS uses
|
2003-09-26 07:23:36 +00:00
|
|
|
;; (which is based on textual comparison), because there can be problems
|
2003-09-24 11:55:45 +00:00
|
|
|
;; generating a time string that looks exactly like the one from CVS.
|
2003-10-01 13:23:34 +00:00
|
|
|
(let ((mtime (nth 5 (file-attributes file))))
|
|
|
|
(require 'parse-time)
|
|
|
|
(let ((parsed-time
|
|
|
|
(parse-time-string (concat (match-string 2) " +0000"))))
|
|
|
|
(cond ((and (not (string-match "\\+" (match-string 2)))
|
|
|
|
(car parsed-time)
|
|
|
|
(equal mtime (apply 'encode-time parsed-time)))
|
|
|
|
(vc-file-setprop file 'vc-checkout-time mtime)
|
|
|
|
(if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
|
|
|
|
(t
|
|
|
|
(vc-file-setprop file 'vc-checkout-time 0)
|
|
|
|
(if set-state (vc-file-setprop file 'vc-state 'edited)))))))))
|
2002-04-08 13:38:48 +00:00
|
|
|
|
2007-07-12 03:13:37 +00:00
|
|
|
;; Completion of revision names.
|
|
|
|
;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use
|
|
|
|
;; `cvs log' so I can list all the revision numbers rather than only
|
|
|
|
;; tag names.
|
|
|
|
|
|
|
|
(defun vc-cvs-revision-table (file)
|
|
|
|
(let ((default-directory (file-name-directory file))
|
|
|
|
(res nil))
|
|
|
|
(with-temp-buffer
|
|
|
|
(vc-cvs-command t nil file "log")
|
|
|
|
(goto-char (point-min))
|
|
|
|
(when (re-search-forward "^symbolic names:\n" nil t)
|
|
|
|
(while (looking-at "^ \\(.*\\): \\(.*\\)")
|
|
|
|
(push (cons (match-string 1) (match-string 2)) res)
|
|
|
|
(forward-line 1)))
|
|
|
|
(while (re-search-forward "^revision \\([0-9.]+\\)" nil t)
|
|
|
|
(push (match-string 1) res))
|
|
|
|
res)))
|
|
|
|
|
2007-10-20 01:07:52 +00:00
|
|
|
(defun vc-cvs-revision-completion-table (files)
|
|
|
|
(lexical-let ((files files)
|
2007-07-12 03:13:37 +00:00
|
|
|
table)
|
|
|
|
(setq table (lazy-completion-table
|
2007-10-20 01:07:52 +00:00
|
|
|
table (lambda () (vc-cvs-revision-table (car files)))))
|
2007-07-12 03:13:37 +00:00
|
|
|
table))
|
|
|
|
|
|
|
|
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
(provide 'vc-cvs)
|
|
|
|
|
2007-07-12 03:13:37 +00:00
|
|
|
;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
|
(vc-cvs-show-log-entry): New function.
(vc-cvs-stay-local): Allow it to be a hostname regexp
as well.
(vc-cvs-remote-p): Renamed to vc-cvs-stay-local-p. Handle
hostname regexps. Updated all callers.
(vc-cvs-responsible-p): Handle directories as well.
(vc-cvs-could-register): New function.
(vc-cvs-retrieve-snapshot): Parse "cvs update" output, keep file
properties up-to-date.
(vc-cvs-checkout): Do the right thing when the
workfile does not exist.
(vc-cvs-registered): Use new function
vc-cvs-parse-entry to do the actual work.
(vc-cvs-remote-p): Allow FILE to be a directory, too.
(vc-cvs-dir-state): New function.
(vc-cvs-dir-state-heuristic): New function, subroutine of the
above.
(vc-cvs-parse-entry): New function, also to be used in
vc-cvs-registered.
(vc-cvs-checkout): Slight restructuring to make the
control-flow more clear and to avoid running `cvs' twice.
(vc-cvs-workfile-version): Removed comment that this
is not reached. It is.
(vc-cvs-merge): Set state to 'edited after merge.
(vc-cvs-merge-news): Set workfile version to nil if not known.
(vc-cvs-latest-on-branch-p): Recommented. Candidate for removal.
(vc-cvs-checkin): Raise the max-correct status from 0
to 1. Make sure to switch to *vc* before looking for an error
message. Use vc-parse-buffer.
(vc-cvs-create-snapshot): Swap DIR and NAME.
(vc-cvs-retrieve-snapshot): New function (untested).
(vc-cvs-stay-local): Default to t.
(vc-cvs-remote-p): New function and property.
(vc-cvs-state): Stay local only if the above is t.
(vc-handle-cvs): Removed.
(vc-cvs-registered): Don't check vc-handle-cvs -- it should all be
done via vc-handled-backends now.
(vc-cvs-header): Escape Id.
(vc-cvs-state, vc-cvs-fetch-status): Use
with-temp-file. Use the new BUFFER=t argument to vc-do-command.
(vc-cvs-print-log, vc-cvs-diff): Insert in the current buffer.
(vc-cvs-state): Use vc-do-command instead of
vc-simple-command.
(vc-cvs-diff): Remove unused and unsupported argument CMP.
(vc-cvs-registered): Obey vc-handle-cvs.
(vc-cvs-registered): Use with-temp-buffer. Reorder
extraction of fields and call to file-attributes because of a
temporary bug in rcp.el.
(vc-cvs-fetch-status): Use with-current-buffer.
Merge in code
from vc-cvs-hooks.el.
(proto vc-cvs-registered): Require 'vc-cvs instead of
'vc-cvs-hooks. Don't require 'vc anymore.
(vc-cvs-responsible-p): Use expand-file-name instead of concat and
file-directory-p instead of file-exists-p.
(vc-cvs-create-snapshot): New function, replacing
vc-cvs-assign-name.
(vc-cvs-assign-name): Remove.
(vc-cvs-header): New var.
Update Copyright.
(vc-cvs-diff): Remove unused `backend' variable.
(vc-cvs-checkout): Only toggle read-only if the buffer is setup
right.
(tail): Provide vc-cvs.
(vc-cvs-merge-news, vc-cvs-checkout): Removed call to
vc-file-clear-masterprops.
(vc-cvs-state): Typo.
(vc-cvs-merge-news): Return the status code rather than the error
msg.
(vc-cvs-state): Don't overwrite a non-heuristic state
with a heuristic one.
(vc-cvs-merge-news): Just use 'edited for the case with conflicts.
(vc-cvs-checkin): Do a trivial parse to set the state in case of
error. That allows us to get to 'needs-merge even in the
stay-local case. There's still no way to detect 'needs-patch in
such a setup (or to force an update for that matter).
(vc-cvs-logentry-check): Remove, the default works as well.
(vc-cvs-print-log, vc-cvs-diff): Run cvs
asynchronously.
(vc-cvs-stay-local): Renamed from
vc-cvs-simple-toggle. Redocumented.
(vc-cvs-state): If locality is wanted, use vc-cvs-state-heuristic.
(vc-cvs-toggle-read-only): Removed.
(for compiler
warnings).
(vc-cvs-release, vc-cvs-system-release): Remove.
(vc-cvs-use-edit, vc-cvs-simple-toggle): New config variables.
(vc-cvs-dired-state-info): Use `cvs-state' and slightly different
status symbols.
(vc-cvs-parse-status, vc-cvs-state): Move from vc-cvs-hooks.el.
(vc-cvs-toggle-read-only): First cut at a function to allow a
cvs-status-free vc-toggle-read-only.
(vc-cvs-merge-news): Move from cvs-merge-news in vc.el.
(vc-cvs-checkin): Use vc-recompute-state+vc-state instead of
vc-cvs-status. Also set vc-state rather than vc-locking-user.
(vc-cvs-checkout): Modify access rights directly if the user
requested not to use `cvs edit'. And refresh the mode line.
(if
workfile' that got lost when the code was extracted from vc.el.
And merged the tail with the rest of the code (not possible in the
old vc.el where the tail was shared among all backends). And
explicitly set the state to 'edited if `writable' is set.
(vc-cvs-revert,vc-cvs-checkout): References to
`vc-checkout-model' updated to `vc-cvs-update-model'.
(vc-cvs-logentry-check): Function added.
(vc-cvs-revert,vc-cvs-checkout): Function calls to
`vc-checkout-required' updated to `vc-cvs-uses-locking'.
(vc-cvs-admin): Added the query-only option as
required by the vc.el file.
(vc-cvs-annotate-difference): Updated to handle
beginning of annotate buffers correctly.
Rename `vc-uses-locking' to
`vc-checkout-required'. Rename the `locked' state to `reserved'.
(vc-cvs-annotate-difference): Handle possible
millenium problem (merged from mainline).
Split the annotate feature into a BACKEND-specific
part and moved the non-BACKEND stuff to vc.el.
(vc-cvs-latest-on-branch-p): Function added.
(vc-cvs-revert): Merged and adapted "unedit" patch
from main line.
(vc-cvs-diff): Function added.
(vc-cvs-checkout): Function `vc-cvs-checkout' added.
Require vc when compiling.
(vc-cvs-register-switches): Doc fix.
(vc-annotate-color-map, vc-annotate-menu-elements): Fix custom type.
(vc-cvs-print-log, vc-cvs-assign-name, vc-cvs-merge)
(vc-cvs-check-headers, vc-cvs-steal, vc-cvs-revert, vc-cvs-checkin):
New functions (code from vc.el).
(vc-annotate-display-default): Fix interactive spec.
(vc-annotate-time-span): Doc fix.
Moved the annotate functionality from vc.el.
(vc-cvs-admin, vc-cvs-fetch-status): Added from vc.el.
(vc-cvs-system-release):
Renamed from vc-cvs-backend-release.
(vc-cvs-release): Moved from vc.el.
(vc-cvs-backend-release): New function.
(vc-cvs-dired-state-info, vc-cvs-fetch-status): Moved
from vc.el and renamed.
2000-09-04 19:48:04 +00:00
|
|
|
;;; vc-cvs.el ends here
|