Differences between revisions 18 and 19
Revision 18 as of 2006-11-19 17:19:46
Size: 5536
Editor: MartinCooper
Comment: Make the case of $Id$ match what we actually use.
Revision 19 as of 2009-09-20 23:12:06
Size: 5554
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
 * Struts Subversion [http://svn.apache.org/viewcvs.cgi/struts/ repository]
   * [http://svn.apache.org/viewcvs.cgi/struts/core/trunk/?root=Apache-SVN Core]
   * [http://svn.apache.org/viewcvs.cgi/struts/el/trunk/?root=Apache-SVN EL]
   * [http://svn.apache.org/viewcvs.cgi/struts/faces/trunk/?root=Apache-SVN Faces]
   * [http://svn.apache.org/viewcvs.cgi/struts/sandbox/trunk/?root=Apache-SVN Sandbox]
 * Apache Subversion [http://www.apache.org/dev/version-control.html checkout instructions]
 * Subversion [http://svnbook.red-bean.com/svnbook-1.1/index.html Red Book]
 * Struts Subversion [[http://svn.apache.org/viewcvs.cgi/struts/|repository]]
   * [[http://svn.apache.org/viewcvs.cgi/struts/core/trunk/?root=Apache-SVN|Core]]
   * [[http://svn.apache.org/viewcvs.cgi/struts/el/trunk/?root=Apache-SVN|EL]]
   * [[http://svn.apache.org/viewcvs.cgi/struts/faces/trunk/?root=Apache-SVN|Faces]]
   * [[http://svn.apache.org/viewcvs.cgi/struts/sandbox/trunk/?root=Apache-SVN|Sandbox]]
 * Apache Subversion [[http://www.apache.org/dev/version-control.html|checkout instructions]]
 * Subversion [[http://svnbook.red-bean.com/svnbook-1.1/index.html|Red Book]]
Line 24: Line 24:
 * [http://svnbook.red-bean.com/svnbook-1.1/ch07s02.html#svn-ch-7-sect-2.4 Automatic Property Setting]
 * [http://svnbook.red-bean.com/svnbook-1.1/ch07.html#svn-ch-7-sect-1.3.2 Configuraton Options]
 * [[http://svnbook.red-bean.com/svnbook-1.1/ch07s02.html#svn-ch-7-sect-2.4|Automatic Property Setting]]
 * [[http://svnbook.red-bean.com/svnbook-1.1/ch07.html#svn-ch-7-sect-1.3.2|Configuraton Options]]

This page is intended for any useful info for SVN

Info

Subversion Properties

Subversion uses properties to record meta data about files. This section describes the use of these properties in Struts.

  • svn:keywords - subversion supports keyword substitution. Need to set the svn:keywords property to space seprated list of the keywords and then add the keywords to the file.

  • svn:eol-style - determines the line ending character on a file.

Configuring the Client: Automatic Property Setting

You should be able to configure the client your using for svn to automatically set properties on newly added files. The following bits of the red book may help.

First you need to set the enable-auto-props to yes. Then in the auto-props section add properties for specified file patterns.

For example, in ~/.subversion/config:

[miscellany]
enable-auto-props = yes

[auto-props]
*.java = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.jsp = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.css = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.htm = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.html = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.xml = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.xsl = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.dtd = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.txt = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.properties = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.tld = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.ftl = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL
*.fml = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL

Struts Subversion Property Settings

Java Source Files

When adding a new java source file the following should be set up:

The new file should have the following properties:

  • svn:eol-style property set to native

  • svn:keywords property set to Date Author Id Revision HeadURL

The new file should contain the following keywords:

  • add the $Id$ keyword in the license comments at the top of the file
  • add @version $Rev$ $Date$ to the javadoc

Documentation

The *.xml documentation files have the following properties set:

  • svn:eol-style property set to native

  • svn:keywords property set to Date Author Id Revision HeadURL

Changing Properties on Existing Files

  • svn propset svn:eol-style native FILENAME
  • svn propset svn:keywords "Date Author Id Revision HeadURL" FILENAME

Updating the list of subprojects for the "current" checkout

The Struts code base takes advantage of a feature of Subversion termed "externals". The concept is similar to how a symbolic link works in the *nix worlds. With Struts, you typically checkout the source code by getting https://svn.apache.org/repos/asf/struts/current/, yet, if you look at this url with a browser, you'll only see 1 file. That's because of our use of svn:externals.

Change directories to where the root of your checkout is.

 $ cd path/to/svn/struts/checkout

Ensure you have an environment variable setup for SVN_EDITOR.

 $ set
...
... (snip'd)
...
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SVN_EDITOR=vi         <=== must have this (or emacs or vim or ??)
TERM=xterm-color
TERM_PROGRAM=Apple_Terminal
...
...

If you don't have it, set it.

 $ export set SVN_EDITOR=vi  (or emacs or vim or whatever)

Now let's edit svn:externals for the root of our checkout.

 $ svn propedit svn:externals .

NOTE - the "." is not a typo - that's how you tell it to edit the svn:external props

(if using vi, it will open up like this)

struts1   https://svn.apache.org/repos/asf/struts/struts1/trunk
struts2   https://svn.apache.org/repos/asf/struts/struts2/trunk
maven     https://svn.apache.org/repos/asf/struts/maven/trunk
sandbox   https://svn.apache.org/repos/asf/struts/sandbox/trunk
shale     https://svn.apache.org/repos/asf/struts/shale/trunk
site      https://svn.apache.org/repos/asf/struts/site

Make your changes, save and exit.

You can check what you've done

 $ svn diff .

Check in your changes

 $ svn commit -m "modified svn:externals for ???" .

StrutsMaintenanceSvn (last edited 2009-09-20 23:12:06 by localhost)