11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Branching and Merging• It can be run at any point in time to bring an existing directory in the repository to exactlymatch an external directory, performing all the necessary adds and deletes, and optionallyperforming moves, too.• It takes care of complicated series of operations between which <strong>Subversion</strong> requires anintermediate commit—such as before renaming a file or directory twice.• It will optionally tag the newly imported directory.• It will optionally add arbitrary properties to files and directories that match a regular expression.svn_load_dirs.pl takes three mandatory arguments. The first argument is the URL to thebase <strong>Subversion</strong> directory to work in. This argument is followed by the URL—relative to thefirst argument—into which the current vendor drop will be imported. Finally, the third argumentis the local directory to import. Using our previous example, a typical run ofsvn_load_dirs.pl might look like this:$ svn_load_dirs.pl http://svn.example.com/repos/vendor/libcomplex \current \/path/to/libcomplex-1.1…You can indicate that you'd like svn_load_dirs.pl to tag the new vendor drop by passingthe -t command-line option and specifying a tag name. This tag is another URL relative tothe first program argument.$ svn_load_dirs.pl -t libcomplex-1.1 \http://svn.example.com/repos/vendor/libcomplex \current \/path/to/libcomplex-1.1…When you run svn_load_dirs.pl, it examines the contents of your existing “current” vendordrop and compares them <strong>with</strong> the proposed new vendor drop. In the trivial case, no fileswill be in one version and not the other, and the script will perform the new import <strong>with</strong>outincident. If, however, there are discrepancies in the file layouts between versions,svn_load_dirs.pl will ask you how to resolve those differences. For example, you will havethe opportunity to tell the script that you know that the file math.c in version 1.0 of libcomplexwas renamed to arithmetic.c in libcomplex 1.1. Any discrepancies not explainedby moves are treated as regular additions and deletions.The script also accepts a separate configuration file for setting properties on files and directoriesmatching a regular expression that are added to the repository. This configurationfile is specified to svn_load_dirs.pl using the -p command-line option. Each line of theconfiguration file is a whitespace-delimited set of two or four values: a Perl-style regular expressionagainst which to match the added path, a control keyword (either break orcont), and then optionally a property name and value.\.png$ break svn:mime-type image/png\.jpe?g$ break svn:mime-type image/jpeg\.m3u$ cont svn:mime-type audio/x-mpegurl\.m3u$ break svn:eol-style LF.* break svn:eol-style nativeFor each added path, the configured property changes whose regular expression matchesthe path are applied in order, unless the control specification is break (which means that119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!