2012-04-26 03:18:47 +00:00
|
|
|
;;; vc-cvs.el --- non-resident support for CVS version-control -*- lexical-binding: 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
|
|
|
|
2012-01-05 09:46:05 +00:00
|
|
|
;; Copyright (C) 1995, 1998-2012 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>
|
2010-08-29 16:17:13 +00:00
|
|
|
;; Package: 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
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
(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
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
(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
|
|
|
|
|
|
|
;; 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
|
2008-05-06 08:06:51 +00:00
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
(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:
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 23:13:41 +00:00
|
|
|
(eval-when-compile (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)
|
|
|
|
|
2008-05-02 17:47:25 +00:00
|
|
|
;;; Properties of the backend.
|
|
|
|
|
|
|
|
(defun vc-cvs-revision-granularity () 'file)
|
|
|
|
|
|
|
|
(defun vc-cvs-checkout-model (files)
|
|
|
|
"CVS-specific version of `vc-checkout-model'."
|
|
|
|
(if (getenv "CVSREAD")
|
|
|
|
'announce
|
|
|
|
(let* ((file (if (consp files) (car files) files))
|
|
|
|
(attrib (file-attributes file)))
|
|
|
|
(or (vc-file-getprop file 'vc-checkout-model)
|
|
|
|
(vc-file-setprop
|
|
|
|
file 'vc-checkout-model
|
|
|
|
(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))))))
|
|
|
|
|
2001-01-25 16:36:48 +00:00
|
|
|
;;;
|
2000-11-16 18:14:41 +00:00
|
|
|
;;; Customization options
|
|
|
|
;;;
|
|
|
|
|
2012-02-25 04:29:09 +00:00
|
|
|
(defgroup vc-cvs nil
|
|
|
|
"VC CVS backend."
|
|
|
|
:version "24.1"
|
|
|
|
:group 'vc)
|
|
|
|
|
2002-03-28 14:29:06 +00:00
|
|
|
(defcustom vc-cvs-global-switches nil
|
2008-12-03 05:48:14 +00:00
|
|
|
"Global switches to pass to any CVS command."
|
2002-03-28 14:29:06 +00:00
|
|
|
: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"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group 'vc-cvs)
|
2002-03-28 14:29:06 +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
|
|
|
(defcustom vc-cvs-register-switches nil
|
2008-12-04 07:00:43 +00:00
|
|
|
"Switches for registering a file into 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
|
|
|
A string or list of strings passed to the checkin program by
|
2008-12-04 07:00:43 +00:00
|
|
|
\\[vc-register]. If nil, use the value of `vc-register-switches'.
|
|
|
|
If t, use no switches."
|
|
|
|
:type '(choice (const :tag "Unspecified" nil)
|
|
|
|
(const :tag "None" 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
|
|
|
(string :tag "Argument String")
|
2008-12-04 07:00:43 +00:00
|
|
|
(repeat :tag "Argument List" :value ("") string))
|
2000-09-07 20:01:53 +00:00
|
|
|
:version "21.1"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group '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
|
|
|
|
2001-02-01 15:10:16 +00:00
|
|
|
(defcustom vc-cvs-diff-switches nil
|
2008-12-03 07:43:33 +00:00
|
|
|
"String or list of strings specifying switches for CVS diff under VC.
|
|
|
|
If nil, use the value of `vc-diff-switches'. If t, use no switches."
|
|
|
|
:type '(choice (const :tag "Unspecified" nil)
|
|
|
|
(const :tag "None" t)
|
|
|
|
(string :tag "Argument String")
|
|
|
|
(repeat :tag "Argument List" :value ("") string))
|
2001-02-01 15:10:16 +00:00
|
|
|
:version "21.1"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group 'vc-cvs)
|
2001-02-01 15:10:16 +00:00
|
|
|
|
2010-10-03 21:05:47 +00:00
|
|
|
(defcustom vc-cvs-header '("\$Id\$")
|
2008-12-03 05:48:14 +00:00
|
|
|
"Header keywords to be inserted by `vc-insert-headers'."
|
2010-10-03 21:05:47 +00:00
|
|
|
:version "24.1" ; no longer consult the obsolete vc-header-alist
|
2001-01-09 14:48:25 +00:00
|
|
|
:type '(repeat string)
|
2012-02-25 04:29:09 +00:00
|
|
|
:group '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
|
|
|
|
|
|
|
(defcustom vc-cvs-use-edit t
|
2008-12-03 05:48:14 +00:00
|
|
|
"Non-nil means to use `cvs edit' to \"check out\" a 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
|
|
|
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"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group '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
|
|
|
|
2008-10-13 01:16:49 +00:00
|
|
|
(defcustom vc-cvs-stay-local 'only-file
|
2008-12-03 05:48:14 +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
|
|
|
|
2008-10-13 01:16:49 +00:00
|
|
|
If value is the symbol `only-file' `vc-dir' will connect to the
|
|
|
|
server, but heuristics will be used to determine the status for
|
|
|
|
all other VC operations.
|
|
|
|
|
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)
|
2008-10-28 17:57:09 +00:00
|
|
|
(const :tag "Only for file operations" only-file)
|
2008-10-13 01:16:49 +00:00
|
|
|
(const :tag "Don't stay local" nil)
|
2008-12-03 07:43:33 +00:00
|
|
|
(list :format "\nExamine hostname and %v"
|
|
|
|
:tag "Examine hostname ..."
|
|
|
|
(set :format "%v" :inline t
|
|
|
|
(const :format "%t" :tag "don't" except))
|
|
|
|
(regexp :format " stay local,\n%t: %v"
|
|
|
|
:tag "if it matches")
|
2003-04-23 12:49:25 +00:00
|
|
|
(repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
|
2008-10-09 04:52:28 +00:00
|
|
|
:version "23.1"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group 'vc-cvs)
|
2008-10-09 04:52:28 +00:00
|
|
|
|
2002-02-21 20:16:47 +00:00
|
|
|
(defcustom vc-cvs-sticky-date-format-string "%c"
|
2008-12-03 05:48:14 +00:00
|
|
|
"Format string for mode-line display of sticky date.
|
2002-02-21 20:16:47 +00:00
|
|
|
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"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group 'vc-cvs)
|
2002-02-21 20:16:47 +00:00
|
|
|
|
|
|
|
(defcustom vc-cvs-sticky-tag-display t
|
2008-12-03 05:48:14 +00:00
|
|
|
"Specify the mode-line display of sticky tags.
|
2002-02-21 20:16:47 +00:00
|
|
|
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"
|
2012-02-25 04:29:09 +00:00
|
|
|
:group 'vc-cvs)
|
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
|
|
|
;;;
|
|
|
|
|
2011-11-24 08:21:03 +00:00
|
|
|
;;;###autoload(defun vc-cvs-registered (f)
|
|
|
|
;;;###autoload "Return non-nil if file F is registered with 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 (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))
|
2008-06-05 18:52:48 +00:00
|
|
|
(or (string= basename "")
|
|
|
|
(with-temp-buffer
|
|
|
|
(vc-cvs-get-entries dirname)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(cond ((re-search-forward
|
|
|
|
(concat "^/" (regexp-quote basename) "/[^/]") nil t)
|
|
|
|
(beginning-of-line)
|
|
|
|
(vc-cvs-parse-entry file)
|
|
|
|
t)
|
|
|
|
(t 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
|
|
|
nil)))
|
|
|
|
|
|
|
|
(defun vc-cvs-state (file)
|
|
|
|
"CVS-specific version of `vc-state'."
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(if (vc-stay-local-p file '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
|
|
|
(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))
|
2009-08-25 08:53:32 +00:00
|
|
|
(let (process-file-side-effects)
|
|
|
|
(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))))
|
2008-03-21 17:53:04 +00:00
|
|
|
(cond
|
|
|
|
((equal checkout-time lastmod) 'up-to-date)
|
|
|
|
((string= (vc-working-revision file) "0") 'added)
|
2008-05-30 16:21:49 +00:00
|
|
|
((null checkout-time) 'unregistered)
|
2008-03-21 17:53:04 +00:00
|
|
|
(t 'edited))))
|
(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-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
|
|
|
|
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)
|
2012-06-02 10:56:09 +00:00
|
|
|
"Return a string for `vc-mode-line' to put in the mode line 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
|
2008-03-21 17:53:04 +00:00
|
|
|
(string
|
|
|
|
(let ((def-ml (vc-default-mode-line-string 'CVS file)))
|
2008-06-03 21:30:35 +00:00
|
|
|
(setq help-echo
|
2008-03-21 17:53:04 +00:00
|
|
|
(get-text-property 0 'help-echo def-ml))
|
|
|
|
def-ml)))
|
2008-06-03 21:30:35 +00:00
|
|
|
(propertize
|
2007-07-22 19:04:11 +00:00
|
|
|
(if (zerop (length sticky-tag))
|
|
|
|
string
|
2008-06-03 21:30:35 +00:00
|
|
|
(setq help-echo (format "%s on the '%s' branch"
|
2007-07-22 19:04:11 +00:00
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-04-26 03:18:47 +00:00
|
|
|
(defun vc-cvs-register (files &optional _rev comment)
|
2007-07-18 16:32:40 +00:00
|
|
|
"Register FILES into the CVS version-control system.
|
|
|
|
COMMENT can be used to provide an initial description of FILES.
|
2008-12-04 07:00:43 +00:00
|
|
|
Passes either `vc-cvs-register-switches' or `vc-register-switches'
|
|
|
|
to the CVS command."
|
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)
|
2008-12-04 18:10:34 +00:00
|
|
|
(setq dir (if (file-exists-p
|
2003-07-04 22:40:26 +00:00
|
|
|
(expand-file-name "CVS/Entries" dir))
|
2008-12-04 18:10:34 +00:00
|
|
|
t
|
|
|
|
(directory-file-name dir))))
|
2003-07-04 22:40:26 +00:00
|
|
|
(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
|
|
|
|
2010-11-01 03:16:48 +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)
|
2011-12-30 02:52:49 +00:00
|
|
|
;; If the input revision is a valid symbolic tag name, we create it
|
2003-05-08 20:44:50 +00:00
|
|
|
;; 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))
|
2008-04-29 15:32:56 +00:00
|
|
|
(mapc 'vc-file-clearprops files))
|
2007-07-18 16:32:40 +00:00
|
|
|
;; 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).
|
2008-05-02 17:47:25 +00:00
|
|
|
(and editable (not (eq (vc-cvs-checkout-model (list file)) 'implicit))
|
2007-07-08 19:34:19 +00:00
|
|
|
(if vc-cvs-use-edit
|
|
|
|
(vc-cvs-command nil 0 file "edit")
|
|
|
|
(set-file-modes file (logior (file-modes file) 128))
|
2012-08-29 15:11:51 +00:00
|
|
|
(if (equal file buffer-file-name) (read-only-mode -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-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(vc-mode-line file 'CVS))
|
2007-07-08 19:34:19 +00:00
|
|
|
(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)
|
2008-05-02 03:30:10 +00:00
|
|
|
(vc-cvs-command nil 0 file "remove" "-f"))
|
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)
|
2008-05-02 17:47:25 +00:00
|
|
|
(unless (eq (vc-cvs-checkout-model (list file)) 'implicit)
|
2001-08-28 17:06:36 +00:00
|
|
|
(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)
|
2008-06-03 21:30:35 +00:00
|
|
|
(progn
|
2008-04-10 07:32:25 +00:00
|
|
|
(vc-file-setprop file 'vc-state 'conflict)
|
|
|
|
;; signal error
|
|
|
|
1)
|
|
|
|
(vc-file-setprop file 'vc-state 'edited)
|
|
|
|
;; signal success
|
|
|
|
0)))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
|
|
|
(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] \\)?"
|
2009-07-07 15:06:00 +00:00
|
|
|
(regexp-quote
|
2010-02-18 19:55:41 +00:00
|
|
|
(substring file (1+ (length (expand-file-name
|
|
|
|
"." default-directory)))))
|
2000-11-16 18:14:41 +00:00
|
|
|
"\\( 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
|
2008-04-10 07:32:25 +00:00
|
|
|
(vc-file-setprop file 'vc-state 'conflict)
|
2000-11-16 18:14:41 +00:00
|
|
|
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)
|
2008-06-03 21:30:35 +00:00
|
|
|
"Modify the change comments for FILES on a specified REV.
|
2007-12-27 11:26:27 +00:00
|
|
|
Will fail unless you have administrative privileges on the repo."
|
2008-04-08 15:59:35 +00:00
|
|
|
(vc-cvs-command nil 0 files "admin" (concat "-m" rev ":" comment)))
|
2001-01-25 16:36:48 +00:00
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
;;; History functions
|
|
|
|
;;;
|
|
|
|
|
2009-08-29 18:56:12 +00:00
|
|
|
(declare-function vc-rcs-print-log-cleanup "vc-rcs" ())
|
|
|
|
|
2012-04-26 03:18:47 +00:00
|
|
|
(defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit)
|
2007-12-27 03:17:24 +00:00
|
|
|
"Get change logs associated with FILES."
|
2009-08-29 18:56:12 +00:00
|
|
|
(require 'vc-rcs)
|
2007-12-27 03:17:24 +00:00
|
|
|
;; 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
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(if (vc-stay-local-p files 'CVS) 'async 0)
|
2009-08-29 18:56:12 +00:00
|
|
|
files "log")
|
|
|
|
(with-current-buffer buffer
|
2009-11-16 20:36:06 +00:00
|
|
|
(vc-exec-after (vc-rcs-print-log-cleanup)))
|
|
|
|
(when limit 'limit-unsupported))
|
2007-07-18 16:32:40 +00:00
|
|
|
|
2008-05-09 17:30:49 +00:00
|
|
|
(defun vc-cvs-comment-history (file)
|
|
|
|
"Get comment history of a file."
|
|
|
|
(vc-call-backend 'RCS 'comment-history file))
|
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."
|
2009-08-25 08:53:32 +00:00
|
|
|
(let* (process-file-side-effects
|
|
|
|
(async (and (not vc-disable-async-diff)
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(vc-stay-local-p files 'CVS)))
|
2007-11-12 03:56:38 +00:00
|
|
|
(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
|
2008-12-03 07:43:33 +00:00
|
|
|
;; This used to append diff-switches and vc-diff-switches,
|
|
|
|
;; which was consistent with the vc-diff-switches doc at that
|
|
|
|
;; time, but not with the actual behavior of any other VC diff.
|
2007-11-12 03:56:38 +00:00
|
|
|
(apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil
|
2008-12-03 07:43:33 +00:00
|
|
|
;; Not a CVS diff, does not use vc-cvs-diff-switches.
|
|
|
|
(append (vc-switches nil 'diff)
|
2007-11-12 03:56:38 +00:00
|
|
|
(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
|
|
|
|
|
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
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(if (vc-stay-local-p file 'CVS)
|
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
|
|
|
|
2008-06-24 02:41:04 +00:00
|
|
|
(declare-function vc-annotate-convert-time "vc-annotate" (time))
|
|
|
|
|
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)))
|
|
|
|
|
2009-08-27 01:50:12 +00:00
|
|
|
(defun vc-cvs-previous-revision (file rev)
|
|
|
|
(vc-call-backend 'RCS 'previous-revision file rev))
|
|
|
|
|
|
|
|
(defun vc-cvs-next-revision (file rev)
|
|
|
|
(vc-call-backend 'RCS 'next-revision file rev))
|
|
|
|
|
|
|
|
;; FIXME: This should probably be replaced by code using cvs2cl.
|
|
|
|
(defun vc-cvs-update-changelog (files)
|
|
|
|
(vc-call-backend 'RCS 'update-changelog files))
|
|
|
|
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
2008-05-15 17:38:50 +00:00
|
|
|
;;; Tag system
|
2000-11-16 18:14:41 +00:00
|
|
|
;;;
|
|
|
|
|
2008-05-15 17:38:50 +00:00
|
|
|
(defun vc-cvs-create-tag (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
|
|
|
|
2008-05-15 17:38:50 +00:00
|
|
|
(defun vc-cvs-retrieve-tag (dir name update)
|
|
|
|
"Retrieve a tag at and below DIR.
|
|
|
|
NAME is the name of the tag; if it is empty, do a `cvs update'.
|
2000-11-16 18:14:41 +00:00
|
|
|
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
|
|
|
|
;;;
|
|
|
|
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(defun vc-cvs-make-version-backups-p (file)
|
|
|
|
"Return non-nil if version backups should be made for FILE."
|
|
|
|
(vc-stay-local-p file 'CVS))
|
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
|
|
|
|
;;;
|
|
|
|
|
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."
|
2008-05-10 13:27:16 +00:00
|
|
|
(apply 'vc-do-command (or buffer "*vc*") 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))))
|
|
|
|
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(defun vc-cvs-stay-local-p (file) ;Back-compatibility.
|
|
|
|
(vc-stay-local-p file 'CVS))
|
2003-07-04 22:40:26 +00:00
|
|
|
|
|
|
|
(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
|
|
|
|
2008-11-12 04:47:18 +00:00
|
|
|
(defun vc-cvs-parse-uhp (path)
|
|
|
|
"parse user@host/path into (user@host /path)"
|
|
|
|
(if (string-match "\\([^/]+\\)\\(/.*\\)" path)
|
|
|
|
(list (match-string 1 path) (match-string 2 path))
|
|
|
|
(list nil path)))
|
|
|
|
|
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
|
2008-11-12 04:47:18 +00:00
|
|
|
[:METHOD:][[USER@]HOSTNAME]:?/path/to/repository
|
2003-04-23 12:49:25 +00:00
|
|
|
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)
|
2008-11-12 04:47:18 +00:00
|
|
|
(let ((uhp (vc-cvs-parse-uhp (car root-list))))
|
|
|
|
(cons (if (car uhp) "ext" "local") uhp)))
|
2003-04-23 12:49:25 +00:00
|
|
|
((= len 2)
|
|
|
|
;; [USER@]HOST:PATH => method `ext'
|
|
|
|
(and (not (equal (car root-list) ""))
|
|
|
|
(cons "ext" root-list)))
|
|
|
|
((= len 3)
|
2008-11-12 04:47:18 +00:00
|
|
|
;; :METHOD:PATH or :METHOD:USER@HOSTNAME/PATH
|
2003-04-23 12:49:25 +00:00
|
|
|
(cons (cadr root-list)
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 23:13:41 +00:00
|
|
|
(vc-cvs-parse-uhp (nth 2 root-list))))
|
2003-04-23 12:49:25 +00:00
|
|
|
(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
|
|
|
|
2008-03-23 18:15:35 +00:00
|
|
|
;; XXX: This does not work correctly for subdirectories. "cvs status"
|
|
|
|
;; information is context sensitive, it contains lines like:
|
|
|
|
;; cvs status: Examining DIRNAME
|
|
|
|
;; and the file entries after that don't show the full path.
|
2008-05-02 07:38:11 +00:00
|
|
|
;; Because of this VC directory listings only show changed files
|
|
|
|
;; at the top level for CVS.
|
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."
|
2008-03-26 07:15:05 +00:00
|
|
|
(let (file status missing)
|
2000-11-16 18:14:41 +00:00
|
|
|
(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))
|
2008-03-26 07:15:05 +00:00
|
|
|
(when (re-search-forward "^File: " nil t)
|
|
|
|
(when (setq missing (looking-at "no file "))
|
|
|
|
(goto-char (match-end 0)))
|
|
|
|
(cond
|
|
|
|
((re-search-forward "\\=\\([^ \t]+\\)" nil t)
|
|
|
|
(setq file (expand-file-name (match-string 1)))
|
2008-05-30 16:21:49 +00:00
|
|
|
(setq status(if (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)
|
|
|
|
(match-string 1) "Unknown"))
|
2008-04-10 07:32:25 +00:00
|
|
|
(when (and full
|
|
|
|
(re-search-forward
|
|
|
|
"\\(RCS Version\\|RCS Revision\\|Repository revision\\):\
|
2000-11-16 18:14:41 +00:00
|
|
|
\[\t ]+\\([0-9.]+\\)"
|
2008-04-10 07:32:25 +00:00
|
|
|
nil t))
|
2008-03-26 07:15:05 +00:00
|
|
|
(vc-file-setprop file 'vc-latest-revision (match-string 2)))
|
|
|
|
(vc-file-setprop
|
|
|
|
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)
|
2008-05-01 19:13:16 +00:00
|
|
|
(if missing 'missing 'needs-update))
|
2008-03-26 07:15:05 +00:00
|
|
|
((string-match "Locally Added" status) 'added)
|
|
|
|
((string-match "Locally Removed" status) 'removed)
|
2008-04-10 07:32:25 +00:00
|
|
|
((string-match "File had conflicts " status) 'conflict)
|
2008-05-30 16:21:49 +00:00
|
|
|
((string-match "Unknown" status) 'unregistered)
|
2008-03-26 07:15:05 +00:00
|
|
|
(t 'edited))))))))
|
2000-11-16 18:14:41 +00:00
|
|
|
|
2008-04-11 15:17:59 +00:00
|
|
|
(defun vc-cvs-after-dir-status (update-function)
|
2008-03-23 00:07:33 +00:00
|
|
|
;; Heavily inspired by vc-cvs-parse-status. AKA a quick hack.
|
2008-05-01 19:28:56 +00:00
|
|
|
;; This needs a lot of testing.
|
2008-03-23 00:07:33 +00:00
|
|
|
(let ((status nil)
|
|
|
|
(status-str nil)
|
|
|
|
(file nil)
|
|
|
|
(result nil)
|
2008-03-26 07:15:05 +00:00
|
|
|
(missing nil)
|
2008-10-06 05:30:25 +00:00
|
|
|
(ignore-next nil)
|
2008-03-23 00:07:33 +00:00
|
|
|
(subdir default-directory))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while
|
|
|
|
;; Look for either a file entry, an unregistered file, or a
|
|
|
|
;; directory change.
|
|
|
|
(re-search-forward
|
2008-10-06 05:30:25 +00:00
|
|
|
"\\(^=+\n\\([^=c?\n].*\n\\|\n\\)+\\)\\|\\(\\(^?? .*\n\\)+\\)\\|\\(^cvs status: \\(Examining\\|nothing\\) .*\n\\)"
|
2008-03-23 00:07:33 +00:00
|
|
|
nil t)
|
2008-05-31 15:23:58 +00:00
|
|
|
;; FIXME: get rid of narrowing here.
|
2008-03-23 00:07:33 +00:00
|
|
|
(narrow-to-region (match-beginning 0) (match-end 0))
|
|
|
|
(goto-char (point-min))
|
|
|
|
;; The subdir
|
|
|
|
(when (looking-at "cvs status: Examining \\(.+\\)")
|
|
|
|
(setq subdir (expand-file-name (match-string 1))))
|
|
|
|
;; Unregistered files
|
|
|
|
(while (looking-at "? \\(.*\\)")
|
2008-06-03 21:30:35 +00:00
|
|
|
(setq file (file-relative-name
|
2008-03-23 00:07:33 +00:00
|
|
|
(expand-file-name (match-string 1) subdir)))
|
2008-03-31 15:36:56 +00:00
|
|
|
(push (list file 'unregistered) result)
|
2008-03-23 00:07:33 +00:00
|
|
|
(forward-line 1))
|
2008-10-06 05:30:25 +00:00
|
|
|
(when (looking-at "cvs status: nothing known about")
|
|
|
|
;; We asked about a non existent file. The output looks like this:
|
|
|
|
|
|
|
|
;; cvs status: nothing known about `lisp/v.diff'
|
|
|
|
;; ===================================================================
|
|
|
|
;; File: no file v.diff Status: Unknown
|
|
|
|
;;
|
|
|
|
;; Working revision: No entry for v.diff
|
|
|
|
;; Repository revision: No revision control file
|
|
|
|
;;
|
|
|
|
|
|
|
|
;; Due to narrowing in this iteration we only see the "cvs
|
|
|
|
;; status:" line, so just set a flag so that we can ignore the
|
|
|
|
;; file in the next iteration.
|
|
|
|
(setq ignore-next t))
|
2008-03-23 00:07:33 +00:00
|
|
|
;; A file entry.
|
2008-05-31 15:23:58 +00:00
|
|
|
(when (re-search-forward "^File: \\(no file \\)?\\(.*[^ \t]\\)[ \t]+Status: \\(.*\\)" nil t)
|
|
|
|
(setq missing (match-string 1))
|
|
|
|
(setq file (file-relative-name
|
|
|
|
(expand-file-name (match-string 2) subdir)))
|
|
|
|
(setq status-str (match-string 3))
|
|
|
|
(setq status
|
|
|
|
(cond
|
|
|
|
((string-match "Up-to-date" status-str) 'up-to-date)
|
|
|
|
((string-match "Locally Modified" status-str) 'edited)
|
|
|
|
((string-match "Needs Merge" status-str) 'needs-merge)
|
|
|
|
((string-match "Needs \\(Checkout\\|Patch\\)" status-str)
|
|
|
|
(if missing 'missing 'needs-update))
|
|
|
|
((string-match "Locally Added" status-str) 'added)
|
|
|
|
((string-match "Locally Removed" status-str) 'removed)
|
|
|
|
((string-match "File had conflicts " status-str) 'conflict)
|
2008-05-31 15:29:36 +00:00
|
|
|
((string-match "Unknown" status-str) 'unregistered)
|
2008-05-31 15:23:58 +00:00
|
|
|
(t 'edited)))
|
2008-10-06 05:30:25 +00:00
|
|
|
(if ignore-next
|
|
|
|
(setq ignore-next nil)
|
|
|
|
(unless (eq status 'up-to-date)
|
|
|
|
(push (list file status) result))))
|
2008-03-23 00:07:33 +00:00
|
|
|
(goto-char (point-max))
|
|
|
|
(widen))
|
2008-05-31 15:32:10 +00:00
|
|
|
(funcall update-function result))
|
2008-04-15 07:26:36 +00:00
|
|
|
;; Alternative implementation: use the "update" command instead of
|
|
|
|
;; the "status" command.
|
|
|
|
;; (let ((result nil)
|
|
|
|
;; (translation '((?? . unregistered)
|
|
|
|
;; (?A . added)
|
|
|
|
;; (?C . conflict)
|
|
|
|
;; (?M . edited)
|
|
|
|
;; (?P . needs-merge)
|
|
|
|
;; (?R . removed)
|
2008-05-01 19:13:16 +00:00
|
|
|
;; (?U . needs-update))))
|
2008-04-15 07:26:36 +00:00
|
|
|
;; (goto-char (point-min))
|
|
|
|
;; (while (not (eobp))
|
|
|
|
;; (if (looking-at "^[ACMPRU?] \\(.*\\)$")
|
2008-06-03 21:30:35 +00:00
|
|
|
;; (push (list (match-string 1)
|
|
|
|
;; (cdr (assoc (char-after) translation)))
|
2008-04-15 07:26:36 +00:00
|
|
|
;; result)
|
|
|
|
;; (cond
|
|
|
|
;; ((looking-at "cvs update: warning: \\(.*\\) was lost")
|
|
|
|
;; ;; Format is:
|
|
|
|
;; ;; cvs update: warning: FILENAME was lost
|
|
|
|
;; ;; U FILENAME
|
|
|
|
;; (push (list (match-string 1) 'missing) result)
|
|
|
|
;; ;; Skip the "U" line
|
|
|
|
;; (forward-line 1))
|
|
|
|
;; ((looking-at "cvs update: New directory `\\(.*\\)' -- ignored")
|
|
|
|
;; (push (list (match-string 1) 'unregistered) result))))
|
|
|
|
;; (forward-line 1))
|
|
|
|
;; (funcall update-function result)))
|
|
|
|
)
|
2008-03-23 00:07:33 +00:00
|
|
|
|
2008-10-04 19:55:00 +00:00
|
|
|
;; Based on vc-cvs-dir-state-heuristic from Emacs 22.
|
2009-10-01 02:23:29 +00:00
|
|
|
;; FIXME does not mention unregistered files.
|
2008-10-04 19:55:00 +00:00
|
|
|
(defun vc-cvs-dir-status-heuristic (dir update-function &optional basedir)
|
|
|
|
"Find the CVS state of all files in DIR, using only local information."
|
|
|
|
(let (file basename status result dirlist)
|
|
|
|
(with-temp-buffer
|
|
|
|
(vc-cvs-get-entries dir)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (not (eobp))
|
|
|
|
(if (looking-at "D/\\([^/]*\\)////")
|
|
|
|
(push (expand-file-name (match-string 1) dir) dirlist)
|
|
|
|
;; CVS-removed files are not taken under VC control.
|
|
|
|
(when (looking-at "/\\([^/]*\\)/[^/-]")
|
|
|
|
(setq basename (match-string 1)
|
|
|
|
file (expand-file-name basename dir)
|
|
|
|
status (or (vc-file-getprop file 'vc-state)
|
|
|
|
(vc-cvs-parse-entry file t)))
|
|
|
|
(unless (eq status 'up-to-date)
|
|
|
|
(push (list (if basedir
|
|
|
|
(file-relative-name file basedir)
|
|
|
|
basename)
|
|
|
|
status) result))))
|
|
|
|
(forward-line 1)))
|
|
|
|
(dolist (subdir dirlist)
|
|
|
|
(setq result (append result
|
|
|
|
(vc-cvs-dir-status-heuristic subdir nil
|
|
|
|
(or basedir dir)))))
|
|
|
|
(if basedir result
|
|
|
|
(funcall update-function result))))
|
|
|
|
|
2008-04-11 15:17:59 +00:00
|
|
|
(defun vc-cvs-dir-status (dir update-function)
|
2008-03-23 00:07:33 +00:00
|
|
|
"Create a list of conses (file . state) for DIR."
|
2008-10-04 19:55:00 +00:00
|
|
|
;; FIXME check all files in DIR instead?
|
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Add an optional argument for the backend, use it instead of
calling vc-backend.
(vc-mode-line): Add an optional argument for the backend. Pass
the backend to vc-state and vc-working-revision. Move code for
special handling for vc-state being a buffer to ...
* vc-rcs.el (vc-rcs-find-file-hook):
* vc-sccs.el (vc-sccs-find-file-hook): ... here. New functions.
* vc-svn.el (vc-svn-state, vc-svn-dir-status, vc-svn-checkout)
(vc-svn-print-log, vc-svn-diff): Pass 'SVN to vc-state,
vc-stay-local-p and vc-mode-line calls.
* vc-cvs.el (vc-cvs-state, vc-cvs-checkout, vc-cvs-print-log)
(vc-cvs-diff, vc-cvs-annotate-command)
(vc-cvs-make-version-backups-p, vc-cvs-stay-local-p)
(vc-cvs-dir-status): Pass 'CVS to vc-state, vc-stay-local-p and
vc-mode-line calls.
* vc.el (vc-deduce-fileset): Use vc-deduce-fileset instead of
direct comparison.
(vc-next-action, vc-transfer-file, vc-rename-file): Also pass the
backend when calling vc-mode-line.
(vc-register): Do not create a closure for calling the vc register
function, call it directly.
2009-06-23 06:35:40 +00:00
|
|
|
(let ((local (vc-stay-local-p dir 'CVS)))
|
2008-10-13 01:16:49 +00:00
|
|
|
(if (and local (not (eq local 'only-file)))
|
|
|
|
(vc-cvs-dir-status-heuristic dir update-function)
|
|
|
|
(vc-cvs-command (current-buffer) 'async dir "-f" "status")
|
|
|
|
;; Alternative implementation: use the "update" command instead of
|
|
|
|
;; the "status" command.
|
|
|
|
;; (vc-cvs-command (current-buffer) 'async
|
|
|
|
;; (file-relative-name dir)
|
|
|
|
;; "-f" "-n" "update" "-d" "-P")
|
|
|
|
(vc-exec-after
|
|
|
|
`(vc-cvs-after-dir-status (quote ,update-function))))))
|
2008-10-28 17:57:09 +00:00
|
|
|
|
2012-04-26 03:18:47 +00:00
|
|
|
(defun vc-cvs-dir-status-files (dir files _default-state update-function)
|
2008-10-04 01:22:26 +00:00
|
|
|
"Create a list of conses (file . state) for DIR."
|
|
|
|
(apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files)
|
|
|
|
(vc-exec-after
|
|
|
|
`(vc-cvs-after-dir-status (quote ,update-function))))
|
|
|
|
|
2008-05-16 19:15:26 +00:00
|
|
|
(defun vc-cvs-file-to-string (file)
|
|
|
|
"Read the content of FILE and return it as a string."
|
|
|
|
(condition-case nil
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents file)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(buffer-substring (point) (point-max)))
|
|
|
|
(file-error nil)))
|
|
|
|
|
2012-04-26 03:18:47 +00:00
|
|
|
(defun vc-cvs-dir-extra-headers (_dir)
|
2008-05-16 19:15:26 +00:00
|
|
|
"Extract and represent per-directory properties of a CVS working copy."
|
2008-05-16 09:23:22 +00:00
|
|
|
(let ((repo
|
2008-05-16 19:15:26 +00:00
|
|
|
(condition-case nil
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents "CVS/Root")
|
|
|
|
(goto-char (point-min))
|
2008-05-16 09:23:22 +00:00
|
|
|
(and (looking-at ":ext:") (delete-char 5))
|
2008-11-04 07:27:26 +00:00
|
|
|
(concat (buffer-substring (point) (1- (point-max))) "\n"))
|
2008-05-16 19:15:26 +00:00
|
|
|
(file-error nil)))
|
|
|
|
(module
|
|
|
|
(condition-case nil
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents "CVS/Repository")
|
|
|
|
(goto-char (point-min))
|
2008-10-25 20:59:38 +00:00
|
|
|
(skip-chars-forward "^\n")
|
|
|
|
(concat (buffer-substring (point-min) (point)) "\n"))
|
2008-05-16 19:15:26 +00:00
|
|
|
(file-error nil))))
|
2008-05-16 09:23:22 +00:00
|
|
|
(concat
|
|
|
|
(cond (repo
|
2008-06-03 21:30:35 +00:00
|
|
|
(concat (propertize "Repository : " 'face 'font-lock-type-face)
|
|
|
|
(propertize repo 'face 'font-lock-variable-name-face)))
|
2008-05-16 09:23:22 +00:00
|
|
|
(t ""))
|
2008-11-04 07:27:26 +00:00
|
|
|
(cond (module
|
|
|
|
(concat (propertize "Module : " 'face 'font-lock-type-face)
|
|
|
|
(propertize module 'face 'font-lock-variable-name-face)))
|
|
|
|
(t ""))
|
|
|
|
(if (file-readable-p "CVS/Tag")
|
|
|
|
(let ((tag (vc-cvs-file-to-string "CVS/Tag")))
|
|
|
|
(cond
|
|
|
|
((string-match "\\`T" tag)
|
|
|
|
(concat (propertize "Tag : " 'face 'font-lock-type-face)
|
|
|
|
(propertize (substring tag 1)
|
|
|
|
'face 'font-lock-variable-name-face)))
|
|
|
|
((string-match "\\`D" tag)
|
|
|
|
(concat (propertize "Date : " 'face 'font-lock-type-face)
|
|
|
|
(propertize (substring tag 1)
|
|
|
|
'face 'font-lock-variable-name-face)))
|
|
|
|
(t ""))))
|
|
|
|
|
2008-06-03 21:30:35 +00:00
|
|
|
;; In CVS, branch is a per-file property, not a per-directory property.
|
|
|
|
;; We can't really do this here without making dangerous assumptions.
|
2008-05-16 19:15:26 +00:00
|
|
|
;;(propertize "Branch: " 'face 'font-lock-type-face)
|
|
|
|
;;(propertize "ADD CODE TO PRINT THE BRANCH NAME\n"
|
|
|
|
;; 'face 'font-lock-warning-face)
|
|
|
|
)))
|
2008-04-21 16:18:12 +00:00
|
|
|
|
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/")
|
|
|
|
(vc-file-setprop file 'vc-checkout-time 0)
|
2007-10-10 18:52:45 +00:00
|
|
|
(vc-file-setprop file 'vc-working-revision "0")
|
2008-03-21 17:53:04 +00:00
|
|
|
(if set-state (vc-file-setprop file 'vc-state 'added)))
|
2000-11-16 18:14:41 +00:00
|
|
|
;; 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-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.
|
2009-10-01 02:23:29 +00:00
|
|
|
(let* ((time (match-string 2))
|
|
|
|
(mtime (nth 5 (file-attributes file)))
|
|
|
|
(parsed-time (progn (require 'parse-time)
|
|
|
|
(parse-time-string (concat time " +0000")))))
|
|
|
|
(cond ((and (not (string-match "\\+" time))
|
|
|
|
(car parsed-time)
|
2012-08-24 04:05:25 +00:00
|
|
|
;; Compare just the seconds part of the file time,
|
|
|
|
;; since CVS file time stamp resolution is just 1 second.
|
|
|
|
(let ((ptime (apply 'encode-time parsed-time)))
|
|
|
|
(and (eq (car mtime) (car ptime))
|
|
|
|
(eq (cadr mtime) (cadr ptime)))))
|
2009-10-01 02:23:29 +00:00
|
|
|
(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)
|
2009-08-25 08:53:32 +00:00
|
|
|
(let (process-file-side-effects
|
|
|
|
(default-directory (file-name-directory file))
|
2007-07-12 03:13:37 +00:00
|
|
|
(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)
|
2012-04-26 03:18:47 +00:00
|
|
|
(letrec ((table (lazy-completion-table
|
|
|
|
table (lambda () (vc-cvs-revision-table (car files))))))
|
2007-07-12 03:13:37 +00:00
|
|
|
table))
|
2008-06-03 21:30:35 +00:00
|
|
|
|
2007-07-12 03:13:37 +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
|
|
|
(provide 'vc-cvs)
|
|
|
|
|
|
|
|
;;; vc-cvs.el ends here
|