[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5. Commands

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Commands"
"pcl-cvs/Commands"へのコメント(無し)
検索全文Elisp

The nodes in this menu contains explanations about all the commands that you can use in PCL-CVS. They are grouped together by type.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.1 Entering PCL-CVS

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Entering%20PCL-CVS"
"pcl-cvs/EnteringPCL-CVS"へのコメント(無し)
検索全文Elisp

Most commands in PCL-CVS require that you have a `*cvs*' buffer. The commands that you use to get one are listed below. For each, a `cvs' process will be run, the output will be parsed by PCL-CVS, and the result will be printed in the `*cvs*' buffer (see 3. Buffer contents, for a description of the buffer's contents).

M-x cvs-update
Run a `cvs update' command. You will be asked for the directory in which the `cvs update' will be run.

M-x cvs-examine
Run a `cvs -n update' command. This is identical to the previous command, except that it will only check what needs to be done but will not change anything. You will be asked for the directory in which the `cvs -n update' will be run.

M-x cvs-status
Run a `cvs status' command. You will be asked for the directory in which the `cvs status' will be run.

M-x cvs-checkout
Run a `cvs checkout' command. You will be asked for the directory in which the `cvs update' will be run and the module to be checked out.

M-x cvs-quickdir
Populate the `*cvs*' buffer by just looking at the `CVS/Entries' files. This is very much like cvs-examine except that it does not access the CVS repository, which is a major advantage when the repository is far away. But of course, it will not be able to detect when a file needs to be updated or merged.

The first four of those commands are also reachable from the menu bar under `Tools->PCL-CVS'. Finally, an alternative way is to visit the CVS administrative subdirectory in your work area with a simple prefix argument. For example C-u C-x C-f ~/my/work/CVS RET. This by default runs cvs-quickdir but the specific behavior can be changed with cvs-dired-action and cvs-dired-use-hook.

By default, the commands above will descend recursively into subdirectories. You can avoid that behavior by including `-l' in the flags for the command. These flags can be set by giving a prefix argument to the command (e.g., by typing C-u M-x cvs-update RET -l RET).



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.2 Setting flags for CVS commands

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Setting%20flags"
"pcl-cvs/SettingflagsforCVScommands"へのコメント(無し)
検索全文Elisp

This section describes the convention used by nearly all PCL-CVS commands for setting optional flags sent to CVS. A single C-u prefix argument is used to cause the command to prompt for flags to be used for the current invocation of the command only. Two C-u prefix arguments are used to prompt for flags which will be set permanently, for the current invocation and all that follow, until the flags are changed, or unless temporary flags are set which override them.

Perhaps an example or two is in order. Say you are about to add a binary file to the repository, and want to specify the flags `-kb' to `cvs add'. You can type C-u a -kb RET, and the file will be added. Subsequent `cvs add' commands will use the previously prevailing flags.

As a second example, say you are about to perform a diff and want to see the result in unified diff format, i.e. you'd like to pass the flag `-u' to both `cvs diff' and `diff'. You'd also like all subsequent diffs to use this flag. You can type C-u C-u = -u RET and the diff will be performed, and the default flags will be set to ("-u"). You can of course override this flag for a single diff by using a single C-u prefix argument.

In addition to this, some commands can take special prefix arguments. These work as follows: When called with a C-u prefix, the user is prompted for a new value of the special prefix and the special prefix is activated for the next command. When called without the C-u prefix, the special prefix is re-activated (with the same value as last time) for the next command. Calling the prefix command again when it's already activated deactivates it. Calling it with the C-u C-u prefix activates it for all subsequent commands until you deactivate it explicitly. The special prefixes are:

T
Toggles whether or not marks will be active in the next command.

b
Provide the next command with a branch (can be any version specifier) to work on.

B
Secondary branch argument. Only meaningful if b is also used. It can be used to provide a second branch argument to cvs-mode-diff or to cvs-mode-update.

M-f
Forces the next command to apply to every selected file rather than only to the ones PCL-CVS thinks are relevant.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.3 Updating the `*cvs*' buffer

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Updating%20the%20buffer"
"pcl-cvs/Updatingthe`*cvs*'buffer"へのコメント(無し)
検索全文Elisp

The following commands can be used from within the `*cvs*' buffer to update the display:

M-u
Runs the command `cvs-update'.

M-e
Runs the command `cvs-examine'.

M-s
Runs the command `cvs-status'.

In addition to the above commands which operate on the whole module, you can run the equivalent CVS command on just a subset of the files/directories with these keys:

O
Runs cvs-mode-update on the selected files. When run on the top-level directory, this is equivalent to M-u.

e
Runs cvs-mode-examine on the selected files. When run on the top-level directory, this is equivalent to M-e.

s
Runs cvs-mode-status on the selected files. When run on the top-level directory, this is equivalent to M-s, except that CVS output will be shown in a `*cvs-info*' buffer that will be put in `cvs-status-mode'.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.4 Movement Commands

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Movement%20commands"
"pcl-cvs/MovementCommands"へのコメント(無し)
検索全文Elisp

You can use most normal Emacs commands to move forward and backward in the buffer. Some keys are rebound to functions that take advantage of the fact that the buffer is a PCL-CVS buffer:

SPC
n
These keys move the cursor one file forward, towards the end of the buffer (cvs-mode-next-line).

p
This key moves one file backward, towards the beginning of the buffer (cvs-mode-previous-line).



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.5 Marking files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Marking%20files"
"pcl-cvs/Markingfiles"へのコメント(無し)
検索全文Elisp

PCL-CVS works on a set of selected files (see 節 4. Selected files). You can mark and unmark files with these commands:

m
This marks the file that the cursor is positioned on. If the cursor is positioned on a directory all files in that directory are marked. (cvs-mode-mark).

u
Unmark the file that the cursor is positioned on. If the cursor is on a directory, all files in that directory are unmarked. (cvs-mode-unmark).

M
Mark all files in the buffer (cvs-mode-mark-all-files).

M-DEL
Unmark all files (cvs-mode-unmark-all-files).

DEL
Unmark the file on the previous line, and move point to that line (cvs-mode-unmark-up).

%
Mark all files matching a regular expression (cvs-mode-mark-matching-files).

S
Mark all files in a particular state, such as "Modified" or "Removed". (cvs-mode-mark-on-state).

T
Toggle use of marks for the next command (cvs-mode-toggle-marks).



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.6 Committing changes

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Committing%20changes"
"pcl-cvs/Committingchanges"へのコメント(無し)
検索全文Elisp

Committing changes basically works as follows:

  1. After having selected the files you want to commit, you type either c or C which brings up a special buffer `*cvs-commit*'.

  2. You type in the log message describing the changes you're about to commit (see 節 6. Editing a Log Message).

  3. When you're happy with it, you type C-c C-c to do the actual commit.

There's no hidden state, so you can abort the process or pick it up again at any time.

The set of files actually committed is really decided only during the very last step, which is a mixed blessing. It allows you to go back and change your mind about which files to commit, but it also means that you might inadvertently change the set of selected files. To reduce the risk of error, C-c C-c will ask for confirmation if the set of selected files has changed between the first step and the last. You can change this last detail with log-edit-confirm.

As for the difference between c (i.e. cvs-mode-commit) and C (i.e. cvs-mode-commit-setup) is that the first gets you straight to `*cvs-commit*' without erasing it or changing anything to its content, while the second first erases `*cvs-commit*' and tries to initialize it with a sane default (it does that by either using a template provided by the CVS administrator or by extracting a relevant log message from a `ChangeLog' file).

If you are editing the files in your Emacs, an automatic `revert-buffer' will be performed. (If the file contains `$Id$' keywords, `cvs commit' will write a new file with the new values substituted. The auto-revert makes sure that you get them into your buffer). The revert will not occur if you have modified your buffer, or if `cvs-auto-revert' is set to `nil'.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.7 Editing files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Editing%20files"
"pcl-cvs/Editingfiles"へのコメント(無し)
検索全文Elisp

There are currently three commands that can be used to find a file (that is, load it into a buffer and start editing it there). These commands work on the line that the cursor is situated at. They always ignore any marked files.

f
Find the file that the cursor points to (cvs-mode-find-file). If the cursor points to a directory, run dired on that directory; See Info file `emacs', node `Dired'.

o
Like f, but use another window (cvs-mode-find-file-other-window).

A
Invoke `add-change-log-entry-other-window' to edit a `ChangeLog' file. The `ChangeLog' file will be found in the directory of the file the cursor points to, or in a parent of that directory. (cvs-mode-add-change-log-entry-other-window).



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.8 Getting info about files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Getting%20info%20about%20files"
"pcl-cvs/Gettinginfoaboutfiles"へのコメント(無し)
検索全文Elisp

l
Call the command cvs-mode-log which runs `cvs log' on all selected files, and show the result in a temporary buffer `*cvs-info*' (see 節 7. Browsing a Log of Changes).

s
Call the command cvs-mode-status which runs `cvs status' on all selected files, and show the result in a temporary buffer `*cvs-info*'.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.9 Adding and removing files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Adding%20and%20removing%20files"
"pcl-cvs/Addingandremovingfiles"へのコメント(無し)
検索全文Elisp

The following commands are available to make it easy to add files to and remove them from the CVS repository.

a
Add all selected files. This command can be used on `Unknown' files (see 節 3. Buffer contents). The status of the file will change to `Added', and you will have to use c (`cvs-mode-commit' see 節 5.6 Committing changes), to really add the file to the repository.

This command can also be used on `Removed' files (before you commit them) to resurrect them.

The command that is run is cvs-mode-add.

r
This command removes the selected files (after prompting for confirmation). The files are deleted from your directory and (unless the status was `Unknown'; see 節 3. Buffer contents) they will also be `cvs remove'd. If the files' status was `Unknown' they will disappear from the buffer. Otherwise their status will change to `Removed', and you must use c (`cvs-mode-commit', see 節 5.6 Committing changes) to commit the removal.

The command that is run is cvs-mode-remove-file.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.10 Undoing changes

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Undoing%20changes"
"pcl-cvs/Undoingchanges"へのコメント(無し)
検索全文Elisp

U
If you have modified a file, and for some reason decide that you don't want to keep the changes, you can undo them with this command. It works by removing your working copy of the file and then getting the latest version from the repository (cvs-mode-undo-local-changes.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.11 Removing handled entries

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Removing%20handled%20entries"
"pcl-cvs/Removinghandledentries"へのコメント(無し)
検索全文Elisp

x
This command allows you to remove all entries that you have processed. More specifically, the lines for `Up-to-date' files (see 節 3. Buffer contents) are removed from the buffer. If a directory becomes empty the heading for that directory is also removed. This makes it easier to get an overview of what needs to be done.

x invokes cvs-mode-remove-handled. If `cvs-auto-remove-handled' is set to non-nil, this will automatically be performed after every commit.

C-k
This command can be used for lines that `cvs-mode-remove-handled' would not delete, but that you want to delete (cvs-mode-acknowledge).



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.12 Ignoring files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Ignoring%20files"
"pcl-cvs/Ignoringfiles"へのコメント(無し)
検索全文Elisp

i
Arrange so that CVS will ignore the selected files. The file names are added to the `.cvsignore' file in the corresponding directory. If the `.cvsignore' file doesn't exist, it will be created.

The `.cvsignore' file should normally be added to the repository, but you could ignore it as well, if you like it better that way.

This runs cvs-mode-ignore.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.13 Viewing differences

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Viewing%20differences"
"pcl-cvs/Viewingdifferences"へのコメント(無し)
検索全文Elisp

=
d =
Display a `cvs diff' between the selected files and the version that they are based on. (cvs-mode-diff).

d b
If CVS finds a conflict while merging two versions of a file (during a `cvs update', see 節 5.3 Updating the `*cvs*' buffer) it will save the original file in a file called `.#file.version' where file is the name of the file, and version is the revision number that file was based on.

With the d b command you can run a `diff' on the files `.#file.version' and `file'.

d h
Display a `cvs diff' between the selected files and the head revision in the repository (the most recent version on the current branch) (cvs-mode-diff-head).

d r
Display a `cvs diff' between the base revision of the selected files and the head revision in the repository. This displays the changes anyone has committed to the repository since you last executed "checkout", "update" or "commit". (cvs-mode-diff-repository).

d v
Display a `cvs diff' between the selected files and the head revision of the vendor branch in the repository. (cvs-mode-diff-vendor).

d y
Display a `cvs diff' between the selected files and yesterday's head revision in the repository. (cvs-mode-diff-yesterday).

By default, `diff' commands ignore the marks. This can be changed with cvs-invert-ignore-marks.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.14 Running ediff

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Invoking%20Ediff"
"pcl-cvs/Runningediff"へのコメント(無し)
検索全文Elisp

d e
This uses ediff (or emerge, depending on `cvs-idiff-imerge-handlers') to allow you to view diffs. If a prefix argument is given, PCL-CVS will prompt for a revision against which the diff should be made, else the default will be to use the BASE revision.

d E
This command use ediff (or emerge, see above) to allow you to do an interactive 3-way merge.

Please note: when the file status is `Conflict', CVS has already performed a merge. The resulting file is not used in any way if you use this command. If you use the q command inside `ediff' (to successfully terminate a merge) the file that CVS created will be overwritten.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.15 Updating files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Updating%20files"
"pcl-cvs/Updatingfiles"へのコメント(無し)
検索全文Elisp

O
Update all selected files with status `Need-update' by running `cvs update' on them. (cvs-mode-update).



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.16 Tagging files

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Tagging%20files"
"pcl-cvs/Taggingfiles"へのコメント(無し)
検索全文Elisp

t
Tag all selected files by running `cvs tag' on them (cvs-mode-tag). It's usually preferable to tag a directory at a time. Rather than selecting all files (which too often doesn't select all files but only the few that are displayed), clear the selection with M-DEL (cvs-mode-unmark-all-files), position the cursor on the directory you want to tag and hit t.

By default, `tag' commands ignore the marks. This can be changed with cvs-invert-ignore-marks. Also, by default `tag' can only be applied to directories, see cvs-force-dir-tag if you want to change this behavior.



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [表紙] [目次] [索引] [検索] [上端 / 下端] [?]

5.17 Miscellaneous commands

URL="http://www.bookshelf.jp/cgi-bin/goto.cgi?file=pcl-cvs&node=Miscellaneous%20commands"
"pcl-cvs/Miscellaneouscommands"へのコメント(無し)
検索全文Elisp

M-x cvs-mode-byte-compile-files
Byte compile all selected files that end in `.el'.

M-x cvs-mode-delete-lock
This command deletes the lock files that the `*cvs*' buffer informs you about. You should normally never have to use this command, since CVS tries very carefully to always remove the lock files itself.

You can only use this command when a message in the `*cvs*' buffer tells you so. You should wait a while before using this command in case someone else is running a cvs command.

Also note that this only works if the repository is local.

?
h
Show a summary of common command key bindings in the echo area (cvs-help).

q
Quit PCL-CVS, killing the `*cvs*' buffer (cvs-mode-quit).


[ << ] [ >> ]           [表紙] [目次] [索引] [検索] [上端 / 下端] [?]