@c This is part of the Emacs manual.
-@c Copyright (C) 2004-2011 Free Software Foundation, Inc.
+@c Copyright (C) 2004-2015 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@c
@c This file is included either in vc-xtra.texi (when producing the
@menu
* Change Logs and VC:: Generating a change log file from log entries.
-* Renaming and VC:: A command to rename both the source and master
- file correctly.
+* VC Delete/Rename:: Deleting and renaming version-controlled files.
* Revision Tags:: Symbolic names for revisions.
* Version Headers:: Inserting version control headers into working files.
@end menu
you can generate change log entries from the version control log
entries of previous commits.
- Note that this only works with RCS or CVS. This procedure would be
+ Note that this only works with RCS or CVS@. This procedure would be
particularly incorrect on a modern changeset-based version control
system, where changes to the @file{ChangeLog} file would normally be
committed as part of a changeset. In that case, you should write the
For example, suppose the first line of @file{ChangeLog} is dated
1999-04-10, and that the only check-in since then was by Nathaniel
Bowditch to @file{rcs2log} on 1999-05-22 with log entry @samp{Ignore
-log messages that start with `#'.}. Then @kbd{C-x v a} inserts this
+log messages that start with '#'.}. Then @kbd{C-x v a} inserts this
@file{ChangeLog} entry:
@iftex
@group
1999-05-22 Nathaniel Bowditch <nat@@apn.org>
- * rcs2log: Ignore log messages that start with `#'.
+ * rcs2log: Ignore log messages that start with '#'.
@end group
@end smallexample
@iftex
such files all have the same text, it coalesces them into a single
entry.
-@node Renaming and VC
-@subsubsection Renaming VC Work Files and Master Files
+@node VC Delete/Rename
+@subsubsection Deleting and Renaming Version-Controlled Files
@cindex renaming version-controlled files
@table @kbd
+@item M-x vc-delete-file
+Prompt for a file name, delete the file from the working tree, and
+schedule the deletion for committing.
+
@item M-x vc-rename-file
-Prompt for two file names, @var{VAR} and @var{OLD}, and rename them in
-the version-controlled working tree.
+Prompt for two file names, @var{var} and @var{old}, rename them in the
+working tree, and schedule the renaming for committing.
@end table
-@findex vc-rename-file
- If you wish to rename a registered file in a version-controlled
-working tree, use the command @kbd{M-x vc-rename-file}. This prompts
-for two arguments: the file you wish to rename, followed by the new
-name; then it performs the renaming through the version control
-system.
+@findex vc-delete-file
+ If you wish to delete a version-controlled file, use the command
+@kbd{M-x vc-delete-file}. This prompts for the file name, and deletes
+it via the version control system. The file is removed from the
+working tree, and in the VC Directory buffer
+@iftex
+(@pxref{VC Directory Mode,,, emacs, the Emacs Manual}),
+@end iftex
+@ifnottex
+(@pxref{VC Directory Mode}),
+@end ifnottex
+it is displayed with the @samp{removed} status. When you commit it,
+the deletion takes effect in the repository.
- On modern version control systems that have built-in support for
-renaming, the renaming operation takes effect immediately in the
+@findex vc-rename-file
+ To rename a version-controlled file, type @kbd{M-x vc-rename-file}.
+This prompts for two arguments: the name of the file you wish to
+rename, and the new name; then it performs the renaming via the
+version control system. The renaming takes effect immediately in the
working tree, and takes effect in the repository when you commit the
-renamed file. The renamed file retains the full change history of the
-original file.
+renamed file.
- On CVS and older version control systems, the @code{vc-rename-file}
-command actually works by creating a copy of the old file under the
-new name, registering it, and deleting the old file. In this case,
-the change history is not preserved.
+ On modern version control systems that have built-in support for
+renaming, the renamed file retains the full change history of the
+original file. On CVS and older version control systems, the
+@code{vc-rename-file} command actually works by creating a copy of the
+old file under the new name, registering it, and deleting the old
+file. In this case, the change history is not preserved.
@node Revision Tags
@subsubsection Revision Tags
or two tagged versions against each other.
On SCCS, VC implements tags itself; these tags are visible only
-through VC. Most later systems (including CVS, Subversion, bzr, git,
+through VC@. Most later systems (including CVS, Subversion, bzr, git,
and hg) have a native tag facility, and VC uses it where available;
those tags will be visible even when you bypass VC.
- In a file-oriented VCS, when you rename a registered file you need
-to rename its master along with it; the command @code{vc-rename-file}
-will do this automatically. If you are using SCCS, you must also
-update the records of the tag, to mention the file by its new name
-(@code{vc-rename-file} does this, too). An old tag that refers to a
-master file that no longer exists under the recorded name is invalid;
-VC can no longer retrieve it. It would be beyond the scope of this
-manual to explain enough about RCS and SCCS to explain how to update
-the tags by hand. Using @code{vc-rename-file} makes the tag remain
-valid for retrieval, but it does not solve all problems. For example,
-some of the files in your program probably refer to others by name.
-At the very least, the makefile probably mentions the file that you
-renamed. If you retrieve an old tag, the renamed file is retrieved
-under its new name, which is not the name that the makefile expects.
-So the program won't really work as retrieved.
+ In file-based version control systems, when you rename a registered
+file you need to rename its master along with it; the command
+@code{vc-rename-file} will do this automatically
+@iftex
+(@pxref{VC Delete/Rename,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{VC Delete/Rename}).
+@end ifnottex
+If you are using SCCS, you must also update the records of the tag, to
+mention the file by its new name (@code{vc-rename-file} does this,
+too). An old tag that refers to a master file that no longer exists
+under the recorded name is invalid; VC can no longer retrieve it. It
+would be beyond the scope of this manual to explain enough about RCS
+and SCCS to explain how to update the tags by hand. Using
+@code{vc-rename-file} makes the tag remain valid for retrieval, but it
+does not solve all problems. For example, some of the files in your
+program probably refer to others by name. At the very least, the
+makefile probably mentions the file that you renamed. If you retrieve
+an old tag, the renamed file is retrieved under its new name, which is
+not the name that the makefile expects. So the program won't really
+work as retrieved.
@node Version Headers
@subsubsection Inserting Version Control Headers
@vindex vc-@var{backend}-header
To insert a suitable header string into the current buffer, type
@kbd{C-x v h} (@code{vc-insert-headers}). This command works only on
-Subversion, CVS, RCS, and SCCS. The variable
+Subversion, CVS, RCS, and SCCS@. The variable
@code{vc-@var{backend}-header} contains the list of keywords to insert
into the version header; for instance, CVS uses @code{vc-cvs-header},
whose default value is @code{'("\$Id\$")}. (The extra backslashes
non-@code{nil}, VC displays messages to indicate which shell commands
it runs, and additional messages when the commands finish.
-@vindex vc-path
- You can specify additional directories to search for version control
-programs by setting the variable @code{vc-path}. These directories
-are searched before the usual search path. It is rarely necessary to
-set this variable, because VC normally finds the proper files
-automatically.
-
@node RCS and SCCS
@subsubsection Options for RCS and SCCS
Then VC always checks the master file to determine the file's status.
VC determines the version control state of files under SCCS much as
-with RCS. It does not consider SCCS version headers, though. Thus,
+with RCS@. It does not consider SCCS version headers, though. Thus,
the variable @code{vc-mistrust-permissions} affects SCCS use, but
@code{vc-consult-headers} does not.
network interactions to a minimum. This is controlled by the variable
@code{vc-cvs-stay-local}. There is another variable,
@code{vc-stay-local}, which enables the feature also for other back
-ends that support it, including CVS. In the following, we will talk
+ends that support it, including CVS@. In the following, we will talk
only about @code{vc-cvs-stay-local}, but everything applies to
@code{vc-stay-local} as well.
- If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines
-the version control status of each file using only the entry in the
-local CVS subdirectory and the information returned by previous CVS
-commands. As a consequence, if you have modified a file and somebody
-else has checked in other changes, you will not be notified of the
-conflict until you try to commit.
+ If @code{vc-cvs-stay-local} is @code{only-file} (the default), VC
+determines the version control status of each file using only the
+entry in the local CVS subdirectory and the information returned by
+previous CVS commands. As a consequence, if you have modified a file
+and somebody else has checked in other changes, you will not be
+notified of the conflict until you try to commit.
If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the
remote repository @emph{before} it decides what to do in
@end ifnottex
except for the additional dot (@samp{.}) after the version. The
relevant VC commands can use both kinds of version backups. The main
-difference is that the ``manual'' version backups made by @kbd{C-x v
+difference is that the manual version backups made by @kbd{C-x v
~} are not deleted automatically when you commit.
@cindex locking (CVS)
locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature;
see the CVS documentation for details. If that case, you can use
@kbd{C-x v v} in Emacs to toggle locking, as you would for a
-locking-based version control system (@pxref{VC With A Locking VCS}).
+locking-based version control system
+@iftex
+(@pxref{VC With A Locking VCS,,,emacs, the Emacs Manual}).
+@end iftex
+@ifnottex
+(@pxref{VC With A Locking VCS}).
+@end ifnottex