| 1 | = Tips and Tricks for committers = |
| 2 | |
| 3 | This page provides some useful hints how to work with our infrastructure. And they can also make your work a lot easier. |
| 4 | |
| 5 | == Set svn properties automatically on new Portfiles == |
| 6 | |
| 7 | In the configuration for your Subversion client, enable automatic property setting and, for all files named Portfile, setting "svn:eol-style" to "native" and "svn:keywords" to "Id". If you are not using Subversion's own svn command-line client, see its documentation. For svn, you can make the appropriate changes by editing `~/.subversion/config` as follows: |
| 8 | |
| 9 | {{{ |
| 10 | ... |
| 11 | |
| 12 | [miscellany] |
| 13 | enable-auto-props |
| 14 | |
| 15 | ... |
| 16 | |
| 17 | [auto-props] |
| 18 | Portfile = svn:eol-style=native;svn:keywords=Id |
| 19 | }}} |
| 20 | |
| 21 | |
| 22 | == Apply patches directly from Trac URL == |
| 23 | |
| 24 | Add the following functions to your `.bashrc` in order to apply patches directly from Trac. |
| 25 | |
| 26 | {{{ |
| 27 | function trac-get { |
| 28 | curl "$1?format=raw" -o $(basename $1) |
| 29 | } |
| 30 | |
| 31 | function trac-patch { |
| 32 | trac-get $1 |
| 33 | patch -p0 < $(basename $1) |
| 34 | } |
| 35 | }}} |
| 36 | |
| 37 | Use like this: |
| 38 | 1. Copy the URL to the patch from the Trac ticket page |
| 39 | 1. Switch to the ports directory |
| 40 | {{{ |
| 41 | $ cd $(port dir foo) |
| 42 | }}} |
| 43 | 1. Apply the patch |
| 44 | {{{ |
| 45 | $ trac-patch http://trac.macosforge.org/projects/macports/attachment/ticket/.../Portfile.diff |
| 46 | }}} |