ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial
Web Hosting by 1&1
32.1.7.2 VC Directory Commands

VC Directory mode has a full set of navigation and marking commands for picking out filesets. Some of these are also available in a context menu invoked by mouse-2.

Up- and down-arrow keys move in the buffer; n and p also move vertically as in other list-browsing modes. <SPC> and <TAB> behave like down-arrow, and <BackTab> behaves like up-arrow.

Both C-m and f visit the file on the current line. o visits that file in another window. q dismisses the directory buffer.

x hides up-to-date files.

m marks the file or directory on the current line. If the region is active, m marks all the files in the region. There are some restrictions when marking: a file cannot be marked if any of its parent directories are marked, and a directory cannot be marked if any files in it or in its child directories are marked.

M marks all the files with the same VC state as the current file if the cursor is on a file. If the cursor is on a directory, it marks all child files. With a prefix argument: marks all files and directories.

u unmarks the file or directory on the current line. If the region is active, it unmarks all the files in the region.

U marks all the files with the same VC state as the current file if the cursor is on a file. If the cursor is on a directory, it unmarks all child files. With a prefix argument: unmarks all marked files and directories.

It is possible to do search, search and replace, incremental search, and incremental regexp search on multiple files. These commands will work on all the marked files or the current file if nothing is marked. If a directory is marked, the files in that directory shown in the VC directory buffer will be used.

S searches the marked files.

Q does a query replace on the marked files.

M-s a C-s does an incremental search on the marked files.

M-s a C-M-s does an incremental regular expression search on the marked files.

Commands are also accessible from the VC-dir menu. Note that some VC backends use the VC-dir menu to make available extra, backend-specific, commands. For example, Git and Bazaar allow you to manipulate stashes and shelves. (These provide a mechanism to temporarily store uncommitted changes somewhere out of the way, and bring them back at a later time.)

Normal VC commands with the C-x v prefix work in VC directory buffers. Some single-key shortcuts are available as well; =, +, l, i, and v behave as through prefixed with C-x v.

The command C-x v v (vc-next-action) operates on all the marked files, so that you can commit several files at once. If the underlying VC supports atomic commits of multiple-file changesets, C-x v v with a selected set of modified but not committed files will commit all of them at once as a single changeset.

When C-x v v (vc-next-action) operates on multiple files, all of those files must be either in the same state or in compatible states (added, modified and removed states are considered compatible). Otherwise it signals an error. This differs from the behavior of older versions of VC, which did not have fileset operations and simply did vc-next-action on each file individually.

If any files are in a state that calls for commit, C-x v v reads a single log entry and uses it for the changeset as a whole. If the underling VCS is file- rather than changeset-oriented, the log entry will be replicated into the history of each file.

blog comments powered by Disqus