This website uses browsing/session and functional cookies to ensure you get the best experience. Learn More

Subversion client flags

From Wiki for iCub and Friends
Revision as of 08:19, 12 June 2013 by Matteo.brunettini@iit.it (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In Subversion each file can have a set of properties. Properties are used by svn to handle files appropriately (for example svn tries to merge only text files but not binary/application files). Properties are stored in the repository and are usually set when a new file is added and committed. If you do not plan to commmit files you can safely assume properties are already correct in the repository and stop bothering reading this. However if you are going to commit files to the repository you must configure your client correctly, see below.

For cvs users. The default behavior of svn differs from cvs, concerning how text and binary files are treated and committed. This page gives more details on this; if you commit files to the repository (and you are not an experienced svn user) please read this carefully and/or make sure you understand how to deal with file properties with svn. The following discussion can be quite technical. If you are a naive svn user, just jump to the instructions at the end of this page (How to configure your svn client).

A Technical explanation

Individual committers can configure SVN locally with an "auto-props" section to automate how properties are assigned to new files they add/import. Once added/imported the properties stay the same; although they can be changed at any time, we strongly recommend to set file properties correctly when files are added to the repository.

Typically you have to enable the auto-props with something like "enable-auto-props = yes" (depending on the client program, see below for instructions). Then you might need to add rules on how to manage individual files (well, wildcards are accepted). Here a list that we find useful for YARP/iCub.

This list also reflects how files should be in the repository. Take this list as a generic guideline, each file can of course have particular properties depending on the situation.

Roughly speaking the meaning of the properties is:

  • eol-style=native: for text files this tells svn to convert end of line characters to match the client systems (Windows or Unix). In this case svn will also try to merge differences when concurrent modifications have been made;
  • svn:mime-type=application/*: this tells svn that the file is binary and should not be touched. No end of line conversion will be made. svn will not resolve conflicts, it will just make a copy of the locally modified file and download the one from the repository.

As a general rule we use application/octet-stream for generic applications, and more specific tags when available (application/x-msword, or postscript...), but it does not make much difference in this context.

List of Properties

*.txt = svn:eol-style=native
*.c = svn:eol-style=native
*.cc = svn:eol-style=native
*.cxx = svn:eol-style=native
*.hpp = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.hpp = svn:eol-style=native
*.inl = svn:eol-style=native
*.cmake = svn:eol-style=native
*.glade = svn:eol-style=native
*.gladep = svn:eol-style=native
*.ui = svn:eol-style=native
*.asv = svn:eol-style=native
*.dat = svn:mime-type=application/octet-stream
*.m = svn:eol-style=native
*.mdl = svn:mime-type=application/octet-stream
*.slx = svn:mime-type=application/octet-stream
*.mat = svn:mime-type=application/octet-stream
*.fig = svn:mime-type=application/octet-stream
*.mexw32 = svn:mime-type=application/octet-stream
*.wbt = svn:eol-style=native
*.bat = svn:eol-style=native
*.cmd = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
*.py = svn:eol-style=native;svn:executable
*.pl = svn:eol-style=native;svn:executable
*.dsw = svn:eol-style=CRLF
*.sln = svn:eol-style=CRLF
*.dsp = svn:eol-style=CRLF
*.mcp = svn:mime-type=application/octet-stream
*.S = svn:mime-type=application/octet-stream
*.mcw = svn:mime-type=application/octet-stream
*.mptags = svn:eol-style=native
*.tagsrc = svn:eol-style=native
*.asm = svn:eol-style=native
*.hex = svn:eol-style=native
*.map = svn:eol-style=native
*.mcs = svn:eol-style=native
*.gld = svn:eol-style=native
*.cww = svn:eol-style=native
*.pjt = svn:eol-style=native
*.PJT = svn:eol-style=native
*.obj = svn.mime-type=application/octet-stream
*.dox = svn:eol-style=native
*.xml = svn:eol-style=native
*.template = svn:eol-style=native
*.ini = svn:eol-style=native
*.cfg = svn:eol-style=native
*.conf = svn:eol-style=native
*.howto = svn:eol-style=native
*.info = svn:eol-style=native
*.html = svn:eol-style=native
*.tex = svn:eol-style=native
*.cls = svn:eol-style=native
*.bib = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
*.bmp = svn:mime-type=image/bmp
*.gif = svn:mime-type=image/gif
*.ppm = svn:mime-type=image/ppm
*.pdf = svn:mime-type=application/pdf
*.eps = svn:mime-type=application/postscript
*.ps = svn:mime-type=application/postscript
*.psd = svn:mime-type=application/photoshop
*.ai = svn:mime-type=application/illustrator
*.zip = svn:mime-type=application/zip 
*.rar = svn:mime-type=application/x-rar-compressed
*.gz = svn:mime-type=application/x-gzip
*.jar = svn:mime-type=application/java-archive
*.doc = svn:mime-type=application/x-msword
*.docx = svn:mime-type=application/x-msword
*.dot = svn:mime-type=application/x-msword
*.xls = svn:mime-type=application/x-excel
*.ppt = svn.mime-type=application/x-mspowerpoint
*.pptx = svn.mime-type=application/x-mspowerpoint
*.bin = svn:mime-type=application/octet-stream
*.lib = svn:mime-type=application/octet-stream
*.a = svn:mime-type=application/octet-stream
*.exe = svn:mime-type=application/octet-stream
*.dll = svn:mime-type=application/octet-stream
*.gbr = svn:eol-style=native
*.BOT = svn:eol-style=native
*.ASB = svn:eol-style=native
*.SSB = svn:eol-style=native
*.AST = svn:eol-style=native
*.DRD = svn:eol-style=native
*.SST = svn:eol-style=native
*.tap = svn:eol-style=native
*.TOP = svn:eol-style=native
*.SMB = svn:eol-style=native
*.SMT = svn:eol-style=native
*.MAX = svn:mime-type=application/octet-stream
*.DSN = svn:mime-type=application/octet-stream
*.DBK = svn:mime-type=application/octet-stream
*.OPJ = svn:eol-style=native
*.opj = svn:eol-style=native
*.GTD = svn:eol-style=native
*.dxf = svn:eol-style=native
*.STEP = svn:eol-style=native
*.BOM = svn:eol-style=native
*.opj = svn:eol-style=native
*.1 = svn:mime-type=application/octet-stream
*.scl = svn:eol-style=native
*.sch = svn:mime-type=application/octet-stream 
*.brd = svn:mime-type=application/octet-stream
*.pcb = svn:mime-type=application/octet-stream
*.snm = svn:mime-type=application/octet-stream
*.avi = svn:mime-type=video/x-msvideo
*.wmv = svn:mime-type=video/x-msvideo
*.mov = svn:mime-type=vide/quicktime
*.mpg = svn:mime-type=video/mpeg
*.mpeg = svn:mime-type=video/mpeg
Makefile = svn:eol-style=native
README = svn:eol-style=native
TODO = svn:eol-style=native
COPYING = svn:eol-style=native
ChangeLog = svn:eol-style=native
INSTALL = svn:eol-style=native
AUTHORS = svn:eol-style=native

How to configure your svn client

This is clearly client dependent. The goal is to change a config file, in Linux this is usually $HOME/.subversion/config.

For Windows we provide an example of how to change the config file of TortoiseSVN:

  • launch Windows Explorer
  • Go to File > TortoiseSVN > Settings
  • Under "General" on the right panel, click "Edit" for "Subversion Configuration File:"
  • The configuration file needs to be changed as follow:
  • Uncomment the "enable-auto-props = yes" directive
  • Uncomment the [auto-props] directive
  • Copy the "List of Properties" from this page (above) to the end of the file, remove the existing list to avoid duplications and make sure you remove the space before the wild-card (*)
  • Save
Personal tools
Namespaces

Variants
Actions
Navigation
Print/export
Toolbox