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.

Advanced TopicsIn this example, you have made some property modifications to button.c, but in yourworking copy, you also have some unversioned files: the latest calculator program thatyou've compiled from your source code, a source file named data.c, and a set of debuggingoutput logfiles. Now, you know that your build system always results in the calculatorprogram being generated. 5 And you know that your test suite always leaves thosedebugging logfiles lying around. These facts are true for all working copies of this project,not just your own. And you know that you aren't interested in seeing those things everytime you run svn status, and you are pretty sure that nobody else is interested in themeither. So you use svn propedit svn:ignore calc to add some ignore patterns tothe calc directory. For example, you might add this as the new value of the svn:ignoreproperty:calculatordebug_log*After you've added this property, you will now have a local property modification on thecalc directory. But notice what else is different about your svn status output:$ svn statusM calcM calc/button.c? calc/data.cNow, all that cruft is missing from the output! Your calculator compiled program and allthose logfiles are still in your working copy; <strong>Subversion</strong> just isn't constantly reminding youthat they are present and unversioned. And now <strong>with</strong> all the uninteresting noise removedfrom the display, you are left <strong>with</strong> more intriguing items—such as that source code filedata.c that you probably forgot to add to version control.Of course, this less-verbose report of your working copy status isn't the only one available.If you actually want to see the ignored files as part of the status report, you can pass the --no-ignore option to <strong>Subversion</strong>:$ svn status --no-ignoreM calcM calc/button.cI calc/calculator? calc/data.cI calc/debug_logI calc/debug_log.1I calc/debug_log.2.gzI calc/debug_log.3.gzAs mentioned earlier, the list of file patterns to ignore is also used by svn add and svn import.Both of these operations involve asking <strong>Subversion</strong> to begin managing some set offiles and directories. Rather than force the user to pick and choose which files in a tree shewishes to start versioning, <strong>Subversion</strong> uses the ignore patterns—both the global and theper-directory lists—to determine which files should not be swept into the version controlsystem as part of a larger recursive addition or import operation. And here again, you canuse the --no-ignore option to tell <strong>Subversion</strong> ignore its ignores list and operate on allthe files and directories present.Even if svn:ignore is set, you may run into problems if you use shell wildcardsin a command. Shell wildcards are expanded into an explicit list of targetsbefore <strong>Subversion</strong> operates on them, so running svn SUBCOMMAND * is5 Isn't that the whole point of a build system?55

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

Saved successfully!

Ooh no, something went wrong!