3.2. Tracking the source code with SVN

SVN (Subversion) is a tool used by many software developers to manage changes within their source code tree. SVN provides the means to store not only the current version of a piece of source code, but a record of all changes (and who made those changes) that have occurred to that source code. Use of SVN is particularly common on projects with multiple developers, since SVN ensures changes made by one developer are not accidentally removed when another developer posts their changes to the source tree. The Bochs source code and documentation is available using SVN[1].

3.2.1. Checking out Bochs

When you have SVN installed, the first step is to do a checkout. The initial checkout command is long and ugly, but usually you only have to do it once. The example below shows the SVN checkout process of the Bochs trunk in Unix. On the Windows platform, you can download a SVN client from subversion.apache.org, or use SVN within Cygwin[2].

Figure 3-1. Checking out Bochs in SVN

  user$ svn co http://svn.code.sf.net/p/bochs/code/trunk/bochs bochs
  A    bochs/ltdl.c
  A    bochs/Makefile.in
  A    bochs/bochs.h
  .
  .   (This might take a few minutes, depending on your network connection.)
  .
  A    bochs/install.sh
   U   bochs
  Checkout, Revision 10754.
  user$ cd bochs
  user$ ls
  aclocal.m4       cpu                 logio.cc        pc_system.cc
  bios             cpudb.h             ltdl.c          pc_system.h
  bochs.h          crc.cc              ltdlconf.h.in   plugin.cc
  build            disasm              ltdl.h          plugin.h
  bx_debug         doc                 ltmain.sh       README
  bxversion.h.in   docs-html           main.cc         README-plugins
  bxversion.rc.in  extplugin.h         Makefile.in     README.rfb
  CHANGES          fpu                 memory          README-wxWindows
  config.cc        gdbstub.cc          misc            TESTFORM.txt
  config.guess     gui                 msrs.def        TODO
  config.h.in      host                osdep.cc        win32_enh_dbg.rc
  config.sub       install-sh          osdep.h         win32res.rc
  configure        instrument          param_names.h   wxbochs.rc
  configure.in     iodev               PARAM_TREE.txt
  COPYING          load32bitOShack.cc  patches
  user$ _

Note: This is just an example output of a checkout of specific version of the Bochs trunk and folder. Depending on the checkout command and revision, you most likely will see more/other files.

Tip: If you have write access to the Bochs SVN tree, see the Developers Guide [3] for details.

The SVN checkout process (above) gives you a directory called bochs that contains the very latest source code. I will refer to this directory as $BOCHS. In this directory there's also a subdirectory called ".svn" which tells the SVN software where the code was checked out, what version you have, and where to go for future updates.

3.2.2. Getting the Latest Version

Most developers use SVN to always give them the latest source code. The minute that any developer checks in a change, they are available to everyone else through SVN. You just have to type svn update in the $BOCHS directory, and SVN will retrieve any files and directories that have been changed since you did a checkout. If you update regularly, each update takes a short time because it downloads only the files that changed. See also Getting a release version.

The svn update command tells you if any new files have been downloaded from the server, and it also tells you if you have modified any of the SVN-controlled files. As it checks through the source directories, it will list files that have changed, with a single letter before the name that tells the status of that file. The most common status letters are listed below.

Table 3-1. Status letters in a SVN update

LetterMeaningDescription
?unknown This file is in your Bochs directory, but SVN does not know anything about it. For example, when you compile Bochs, any files created during the build process appear as ?.
Uupdate SVN downloaded a new version of this file because it changed on the server, usually because someone else did a checkin.
Aadded SVN downloaded a newly added file from the server.
Ddeleted This file has been deleted on the server and SVN removed it from your local copy.
Cconflict You have changed this file on your disk, but this change conflicts with a change that was checked in. Conflicts occur when two people change the same line of code in different ways. You need to edit the conflicting file(s) and clean it up by hand. Or, sometimes it's easiest to discard your own edits and download a fresh copy, by deleting the conflicting file and running svn update again.

3.2.3. Getting a Release Version

You can also use the SVN checkout command to get the Bochs source code for any release since March 2000. The command is

  user$ svn co http://svn.code.sf.net/p/bochs/code/tags/tagname/bochs bochs
The tagname tells which release you want, and it can be one of the following:

Table 3-2. Bochs Release Tags

Bochs versionRelease tag for SVNSVN revision
2.7REL_2_7_FINAL14332
2.6.11 (bugfix)REL_2_6_11_FINAL13774
2.6.10 (intermediate)REL_2_6_10_FINAL13629
2.6.9 (intermediate)REL_2_6_9_FINAL13181
2.6.8 (intermediate)REL_2_6_8_FINAL12740
2.6.7 (intermediate)REL_2_6_7_FINAL12531
2.6.6 (bugfix)REL_2_6_6_FINAL12375
2.6.5 (intermediate)REL_2_6_5_FINAL12349
2.6.2 (bugfix)REL_2_6_2_FINAL11694
2.6.1 (intermediate)REL_2_6_1_FINAL11667
2.6REL_2_6_FINAL11395
2.5.1 (bugfix)REL_2_5_1_FINAL10946
2.5REL_2_5_FINAL10801
2.4.6REL_2_4_6_FINAL10202
2.4.5REL_2_4_5_FINAL9914
2.4.2REL_2_4_2_FINAL9568
2.4.1REL_2_4_1_FINAL9368
2.4REL_2_4_FINAL9289
2.3.7REL_2_3_7_FINAL8537
2.3.6REL_2_3_6_FINAL8111
2.3.5REL_2_3_5_FINAL7840
2.3REL_2_3_FINAL7538
2.2.6 (intermediate2)REL_2_2_6_FINAL7060
2.2.5 (intermediate1)REL_2_2_5_FINAL6942
2.2.1 (bugfix1)REL_2_2_1_FINAL6624
2.2REL_2_2_FINAL6476
2.1.1 (bugfix1)REL_2_1_1_FINAL5560
2.1REL_2_1_FINAL5441
2.0.2 (bugfix2)REL_2_0_2_FINAL4592
2.0.1 (bugfix1)REL_2_0_1_FINAL4491
2.0REL_2_0_FINAL4409
1.4.1 (bugfix1)REL_1_4_1_FINAL2513
1.4REL_1_4_FINAL2235
1.3REL_1_3_FINAL1705
1.2.1 (bugfix1)REL_1_2_1_FINAL912
1.2REL_1_2_FINAL797
1.1.2 (bugfix3)REL_1_1_2_BASE510
1.1.1 (bugfix2)REL_1_1_1_BASE57
1.1 (bugfix1)REL_1_1_BASE51
1.0 (bochs-2000_0325a)REL-bochs-2000-03-257

3.2.4. More about SVN

Entire books have been written on SVN, so there's no sense in duplicating it all here in the Bochs documentation. Some sources of additional information is listed below.

Notes

[1]

You can download SVN software and documentation from subversion.apache.org.

[2]

Cygwin is an open source Unix-like environment for Windows platforms, available at www.cygwin.com.

[3]

See the Developers Guide and/or look at SourceForge's Subversion documentation, for instructions.