Follow this link to skip to the main content

Instructions on CVS Merges in Emacs

By D. Gaines
4/25/05

These instructions are for Emacs and not XEmacs. I know you can get to this same tool through XEmacs but it might be a slightly different procedure.

Emacs has a nice tool to help resolve CVS conflicts (whether you got them from doing a cvs update or a cvs join). To invoke the tool:

  1. From the ``Tools'' menu, select the ``PCL-CVS'' menu item and then the ``Examine Directory'' submenu item.
  2. It will prompt you for a directory. Enter the directory where your conflict was, or hit return for the default directory.
  3. Place your cursor on a line with the conflicted file you are interested in.
  4. Type `d' (for diff)
  5. Type `E' (don't know what it stands for but maybe the three ``ends'' of the E represent the 3-way comparison...?)

This will split your window into three buffers with three versions of the file:

  • A: your file before the update/join (i.e. the .# file that CVS creates when you get a conflict)
  • B: the repository version
  • C: the merged version with conflicts (when I run this, Emacs also nicely labels the conflicted code with A: or B: to indicate which file it came from (someone who did this w/ XEmacs did not get this behavior, so I don't know if it an Emacs/XEmacs difference or what...)

Looks something like this:

 
      Your version before update
          (.#...)

A:


      Repository version

B:


                           Merged version with conflicts
C:

A separate window pops up for controlling/navigating through the diffs. This window behaves just like the normal Emacs diff tool. Hit ? for help if you don't know how to use it.