Make svn --version (and svnsync --version, etc) tell you if ra_svn has
[svn.git] / www / faq.html
blobea8f748816695d0e6365756060d204e8316eaaaa
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6 <style type="text/css"> /* <![CDATA[ */
7 @import "branding/css/tigris.css";
8 @import "branding/css/inst.css";
9 /* ]]> */</style>
10 <link rel="stylesheet" type="text/css" media="print"
11 href="branding/css/print.css"/>
12 <script type="text/javascript" src="branding/scripts/tigris.js"></script>
13 <title>Subversion FAQ</title>
14 </head>
16 <body>
17 <div class="app">
19 <h1>Subversion FAQ</h1>
22 <div class="h2"><!-- no 'id' or 'title' attribute for TOC -->
23 <h2>Table of Contents</h2>
25 <h4>General questions:</h4>
26 <ul>
27 <li><a href="#why">Why does this project exist?</a></li>
28 <li><a href="#collab">Is Subversion proprietary? I heard that it
29 belongs to CollabNet.</a></li>
30 <li><a href="#stable">Is Subversion stable enough for me to use for my
31 own projects?</a></li>
32 <li><a href="#interop">What is Subversion's client/server interoperability
33 policy?</a></li>
34 <li><a href="#portability">What operating systems does Subversion run
35 on?</a></li>
36 <li><a href="#filesystem">What's all this about a new filesystem? Is
37 it like ext2?</a></li>
38 <li><a href="#server-requirements">What kind of hardware do I need to run
39 a Subversion server?</a></li>
40 <li><a href="#apache-extension">I heard that Subversion is an Apache
41 extension? What does it use for servers?</a></li>
42 <li><a href="#need-apache">Does this mean I have to set up Apache to
43 use Subversion?</a></li>
44 <li><a href="#multiple-apachim">I run Apache 1.x right now, and can't
45 switch to Apache 2.0 just to serve Subversion repositories.
46 Does that mean I can't run a Subversion server?</a></li>
47 <li><a href="#feature-x">Why don't you do X, just like SCM system Y?</a></li>
48 <li><a href="#globalrev">Why does the entire repository share the
49 same revision number? I want each of my projects to have their
50 own revision numbers. </a></li>
51 <li><a href="#changesets">Does Subversion have changesets?</a></li>
52 <li><a href="#release">When's the next release?</a></li>
53 <li><a href="#symlinks">Does Subversion support symlinks?</a></li>
54 <li><a href="#logo">I need a high resolution version of the Subversion logo,
55 where can I get it?</a></li>
56 <li><a href="#more-information">I have other questions. Where can I
57 get more information?</a></li>
58 <li><a href="#moderation">Why isn't my post showing up on the mailing
59 list?</a></li>
60 </ul>
62 <h4>How-to:</h4>
63 <ul>
64 <li><a href="#co-svn">How do I check out the Subversion code?</a></li>
65 <li><a href="#repository">How do I create a repository? How do I
66 import data into it?</a></li>
67 <li><a href="#cvs2svn">How do I convert an existing CVS repository
68 into a Subversion repository?</a></li>
69 <li><a href="#proxy">What if I'm behind a proxy?</a></li>
70 <li><a href="#paranoid">My admins don't want me to have a HTTP server for
71 Subversion. What can I do if I still want remote usage?</a></li>
72 <li><a href="#multi-proj">How do I manage several different projects
73 under Subversion?</a></li>
74 <li><a href="#multi-merge">How do I merge two completely separate repositories?</a></li>
75 <li><a href="#nfs">Should I store my repository / working copy on a
76 NFS server?</a></li>
77 <li><a href="#bdblogs">Why is my repository taking up so much disk space?</a></li>
78 <li><a href="#reposperms">How do I set repository permissions correctly?</a></li>
79 <li><a href="#readonly">Why do read-only operations still need repository write access?</a></li>
80 <li><a href="#removal">How do I completely remove a file from the repository's history?</a></li>
81 <li><a href="#change-log-msg">How do I change the log message for a revision
82 after it's been committed?</a></li>
83 <li><a href="#patch">How do I submit a patch for Subversion?</a></li>
84 <li><a href="#in-place-import">How can I do an in-place 'import'
85 (i.e. add a tree to Subversion such that the original data becomes
86 a working copy directly)?</a></li>
87 <li><a href="#dumpload">What is this "dump/load cycle" people
88 sometimes talk about when upgrading a Subversion server?</a></li>
89 <li><a href="#sspi">How do I allow clients to authenticate against a
90 Windows domain controller using SSPI Authentication?</a></li>
91 <li><a href="#adm-dir">I don't like the ".svn" directory name, and
92 prefer "SVN" or something else. How do I change it?</a></li>
93 <li><a href="#case-change">How do I change the case of a filename?</a></li>
94 <li><a href="#merge-using-tags">I can't use tags to merge changes from a
95 branch into the trunk like I used to with CVS, can I?</a></li>
96 <li><a href="#version-value-in-source">Why doesn't the $Revision$
97 keyword do what I want? It expands to the file's last-changed
98 revision, but I want something that will expand to the file's
99 current revision.</a></li>
100 <li><a href="#log-in-source">Does Subversion have a keyword which behaves
101 like $Log$ in CVS?</a></li>
102 <li><a href="#ignore-commit">I have a file in my project that every
103 developer must change, but I don't want those local mods to ever be
104 committed. How can I make 'svn commit' ignore the file?</a></li>
105 <li><a href="#ssh-auth-cache">When I access a repository using
106 svn+ssh, my password is not cached in ~/.subversion/auth/. How do
107 I avoid having to type it so often?</a></li>
108 <li><a href="#ssh-svnserve-location">My
109 <tt>svnserve</tt> binary is in a directory that isn't on my
110 users' default <tt>PATH</tt>s, they use svn+ssh, and I can't figure
111 out how to modify their <tt>PATH</tt> so that they can run <tt>svnserve</tt>.</a></li>
112 <li><a href="#ssh-authorized-keys-trick">
113 I want to allow access via svn+ssh://, but am paranoid. I hate the
114 idea of giving each user a login; I would then have to worry about
115 what they are, and are not, allowed to access on my machine.
116 </a></li>
117 <li><a href="#auto-props">How can I set certain properties on
118 everything in the repository? Also, how can I make sure that every
119 new file coming into the repository has these properties?</a></li>
120 <li><a href="#svn-editor">How do I handle spaces in the editor path?</a></li>
121 <li><a href="#divining-bdb-version">How do I determine which version of
122 Berkeley DB a repository is using?</a></li>
123 <li><a href="#website-auto-update">I'm managing a website in my
124 repository. How can I make the live site automatically update after
125 every commit?</a></li>
126 <li><a href="#single-file-checkout">How do I check out a single
127 file?</a></li>
128 <li><a href="#wc-change-detection">How do I detect adds, deletes,
129 copies and renames in a working copy after they've already
130 happened?</a></li>
131 <li><a href="#svnserve-win-service">How do I run svnserve as a service
132 on Windows?</a></li>
133 <li><a href="#bdb-fsfs-convert">How do I convert my repository from using BDB
134 to FSFS or from FSFS to BDB?</a></li>
135 <li><a href="#binary-files">How does Subversion handle binary files?</a></li>
136 <li><a href="#terse-diff">How can I make <tt>svn diff</tt> show me
137 just the names of the changed files, not their contents?</a></li>
138 <li>
139 <a href="#sorry-no-globbing">How can I use wildcards or globbing to move many files at once?</a>
140 </li>
141 <li><a href="#vendor-branch">How can I maintain a modified version (a
142 "vendor branch") of third-party software using Subversion?</a></li>
143 </ul>
145 <h4>Troubleshooting:</h4>
146 <ul>
147 <li><a href="#stuck-bdb-repos">My repository seems to get stuck all the
148 time, giving me errors about needing recovery (DB_RUNRECOVERY).
149 What could be the cause?</a></li>
150 <li><a href="#bdb-recovery">Every time I try to access
151 my repository, the process just hangs. Is my repository
152 corrupt?</a></li>
153 <li><a href="#bdb-cannot-allocate-memory">My repository keeps giving
154 errors saying "Cannot allocate memory". What should I do?</a></li>
155 <li><a href="#wedged-wc">Every time I try to run a svn
156 command, it says my working copy is locked. Is my working copy
157 corrupt?</a></li>
158 <li><a href="#wc-out-of-date">I'm trying to commit, but Subversion says my
159 working copy is out of date?</a></li>
160 <li><a href="#obstructed-add">I've contributed a patch to a project and the patch added a new file.
161 Now <tt>svn update</tt> does not work.</a></li>
162 <li><a href="#unrecognized-url-error">I just built the distribution
163 binary, and when I try to check out Subversion, I get an error
164 about an "Unrecognized URL scheme." What's up with that?</a></li>
165 <li><a href="#db-recover">I'm getting errors finding or opening a repository,
166 but I know my repository URL is correct. What's wrong?</a></li>
167 <li><a href="#configure-sed-error">When I run `<tt>configure</tt>', I
168 get errors <tt>subs-1.sed&nbsp;line&nbsp;38:&nbsp;Unterminated&nbsp;`s'&nbsp;command</tt>. What's wrong?</a></li>
169 <li><a href="#windows-msvc-build">I'm having trouble building
170 Subversion under Windows with MSVC++ 6.0. What should I do?</a></li>
171 <li><a href="#windows-drive-letter">How can I specify a Windows drive letter in
172 a <tt>file:</tt> URL?</a></li>
173 <li><a href="#write-over-dav">I'm having trouble doing write
174 operations to a Subversion repository over a network.</a></li>
175 <li><a href="#vs-asp-net">VS.NET/ASP.NET seems to have a problem with
176 the ".svn" directory name. What should I do?</a></li>
177 <li><a href="#windows-xp-server">Under Windows XP, the Subversion
178 server sometimes seems to send out corrupted data. Can this really be
179 happening?</a></li>
180 <li><a href="#net-trace">What is the best method of doing a network
181 trace of the conversation between a Subversion client and server?</a></li>
182 <li><a href="#revert">Why does the <tt>svn revert</tt> require an
183 explicit target? Why is it not recursive by default? These
184 behaviors differ from almost all the other subcommands.</a></li>
185 <li><a href="#db3db4">When I start Apache, mod_dav_svn complains about
186 a "bad database version", that it found db-3.X, rather than
187 db-4.X.</a></li>
188 <li><a href="#redhat-db">I'm getting "Function not implemented" errors on
189 Red Hat 9, and nothing works. How do I fix this?</a></li>
190 <li><a href="#no-author">Why does SVN log say "(no author)" for files
191 committed or imported via Apache (ra_dav)?</a></li>
192 <li><a href="#windows-access-denied">I'm getting occasional "Access Denied"
193 errors on Windows. They seem to happen at random. Why?</a></li>
194 <li><a href="#freebsd-hang">On FreeBSD, certain operations (especially
195 svnadmin create) sometimes hang. Why?</a></li>
196 <li><a href="#http-301-error">I can see my repository in a web browser, but
197 'svn checkout' gives me an error about "301 Moved Permanently".
198 What's wrong?</a></li>
199 <li><a href="#no-copy-history">I'm trying to look at an old version of my
200 file, but svn says something about "path not found". What's going
201 on?</a></li>
202 <li><a href="#digest-auth">Why doesn't HTTP Digest auth work?</a></li>
203 <li><a href="#xlc-compile">Compiling with xlc on AIX, I get compilation
204 errors. What's wrong?</a></li>
205 <li><a href="#nonrecursive-checkout">I checked out a directory
206 non-recursively (with -N), and now I want to make certain
207 subdirectories "appear". But <tt>svn up subdir</tt> doesn't
208 work.</a></li>
209 <li><a href="#mod_dav_svn-win32">I am trying to use mod_dav_svn
210 with Apache on Win32 and I'm getting an error saying that the
211 module cannot be found, yet the mod_dav_svn.so file is right
212 there in <tt>\Apache\modules.</tt></a></li>
213 <li><a href="#hook-debugging">Why aren't my repository hooks working?</a></li>
214 <li><a href="#diff-cmd">Why does my --diff-cmd complain about '-u'?
215 I tried to override it with --extensions, but it's not working.</a></li>
216 <li><a href="#plaintext-passwords">Ahhh! I just discovered that my
217 Subversion client is caching passwords in plain-text on disk!
218 AHHH!</a></li>
219 <li><a href="#bdb41-tabletype-bug">I'm getting the error "svn: bdb: call
220 implies an access method which is inconsistent with previous
221 calls". How do I fix this?</a></li>
222 <li><a href="#hotcopy-large-repos">I can't hotbackup my repository, svnadmin
223 fails on files larger than 2Gb!</a></li>
224 <li><a href="#hidden-log">I cannot see the log entry for the file
225 I just committed. Why?</a></li>
226 <li><a href="#bdb43-upgrade">After upgrading to Berkeley DB
227 4.3 or later, I'm seeing repository errors.</a></li>
228 <li><a href="#tiger-apr-0.9.6">Why do I get occasional, seemingly
229 inconsistent errors when checking out over http:// from a repository
230 running on MacOS X 10.4 (Tiger)?</a></li>
231 <li><a href="#debian-libtool">I can't build Subversion from working
232 copy source on Debian GNU/Linux; I get errors at the final link
233 stage. What's wrong?</a></li>
234 <li><a href="#freebsd-listen-host">I'm using FreeBSD, and I've started
235 svnserve, but it doesn't seem to be listening on port 3690.</a></li>
236 <li><a href="#already-under-version-control">I can't add a directory
237 because Subversion says it's "already under version control".</a></li>
238 <li><a href="#slow-private-svnserve">Accessing non-public repositories
239 via svnserve is really slow sometimes.</a></li>
240 <li><a href="#ssl-negotiation-error">When performing Subversion
241 operations involving a lot of data over SSL, I get the error
242 <tt>SSL negotiation failed: SSL error: decryption failed or bad
243 record mac</tt>.</a></li>
244 <li><a href="#broken-subclipse">I get an error that says "This client is too
245 old".</a></li>
246 <li><a href="#switch-problems">Why doesn't <tt>svn switch</tt> work
247 in some cases?</a></li>
248 <li><a href="#long-paths">In Windows, when doing an update with the
249 command-line client, I get an error saying "The
250 system cannot find the path specified" and suggesting that my
251 working copy might be corrupt. But I can update with TortoiseSVN
252 just fine. What's going on?</a></li>
253 <li><a href="#working-copy-format-change">I got an error saying "This
254 client is too old to work with working copy '...' ". How can I
255 fix it without upgrading Subversion?</a></li>
256 </ul>
258 <h4>Developer questions:</h4>
259 <ul>
260 <li><a href="#ramdisk-tests">How do I run the regression tests in a
261 RAM disk?</a></li>
262 <li><a href="#dynamic-exe-debugging">How do I run a debugger on
263 dynamic Subversion binaries without having to install
264 them?</a></li>
265 <li><a href="#avoiding-compiler-inlining">How do I run a debugger on
266 Subversion binaries without compiler inlining obfuscating the
267 source?</a></li>
268 </ul>
270 <h4>References:</h4>
271 <ul>
272 <li><a href="#http-methods">What are all the HTTP methods Subversion
273 uses?</a></li>
274 <li><a href="#bikeshed">What's a 'bikeshed'?</a></li>
275 <li><a href="#pronounce">How do you pronounce "Subversion"?</a></li>
276 <li><a href="#baton">What's a 'baton'?</a></li>
277 <li><a href="#def-wedged-repository">What do you mean when you say that
278 repository is 'wedged'?</a></li>
279 </ul>
281 </div>
284 <hr/>
286 <div class="h2" id="general-questions" title="general-questions">
287 <h2>General questions:</h2>
290 <div class="h3" id="why" title="why">
291 <h3>Why does this project exist?</h3>
293 <p>To take over the CVS user base. Specifically, we're writing a new
294 version control system that is very similar to CVS, but fixes many
295 things that are broken. See our front page.</p>
297 </div>
300 <div class="h3" id="collab" title="collab">
301 <h3>Is Subversion proprietary? I heard that it
302 belongs to CollabNet.</h3>
304 <p>No, Subversion is open source / free software. CollabNet pays the
305 salaries of several full-time developers, and holds the copyright on
306 the code, but that copyright is <a
307 href="http://subversion.tigris.org/license-1.html">an
308 Apache/BSD-style license</a>
309 which is fully compliant with the <a
310 href="http://www.debian.org/social_contract#guidelines">Debian Free
311 Software Guidelines</a>. In other words, you are free to download,
312 modify, and redistribute Subversion as you please; no permission from
313 CollabNet or anyone else is required.</p>
315 </div>
318 <div class="h3" id="stable" title="stable">
319 <h3>Is Subversion stable enough for me to use for my
320 own projects?</h3>
322 <p>Yes, absolutely. It's ready for prime-time production.</p>
324 <p>Subversion has been in development since 2000, and became
325 self-hosting after one year. A year later when we declared "alpha",
326 Subversion was already being used by dozens of private developers and
327 shops for real work. After that, it was two more years of bugfixing
328 and stabilization until we reached 1.0. Most other projects probably
329 would have called the product "1.0" much earlier, but we deliberately
330 decided to delay that label as long as possible. We were aware that
331 many people were waiting for a 1.0 before using Subversion, and had
332 very specific expectations about the meaning of that label. So we
333 stuck to that same standard.</p>
335 </div>
339 <div class="h3" id="interop" title="interop">
340 <h3>What is Subversion's client/server
341 interoperability policy?</h3>
343 <p>The client and server are designed to work as long as they aren't
344 more than one major release version apart. For example, any 1.X
345 client will work with a 1.Y server. However, if the client and
346 server versions don't match, certain features may not be available.</p>
348 <p>See the client/server interoperability policy is documented in the
349 "Compatibility" section of the <a href="hacking.html">Hacker's Guide
350 to Subversion</a>.</p>
352 </div>
355 <div class="h3" id="portability" title="portability">
356 <h3>What operating systems does Subversion run
357 on?</h3>
359 <p>All modern flavors of Unix, Win32, BeOS, OS/2, MacOS X.</p>
361 <p>Subversion is written in ANSI C and uses APR, the <a
362 href="http://apr.apache.org">Apache Portable Runtime</a> library, as a
363 portability layer. The Subversion client will run anywhere APR runs,
364 which is most places. The Subversion server (i.e., the repository
365 side) is the same, except that it will not host a Berkeley DB repository
366 on Win9x platforms (Win95/Win98/WinME), because Berkeley DB has
367 shared-memory segment problems on Win9x. FSFS repositories
368 (introduced in version 1.1) do not have this restriction; however, due
369 to a limitation in Win9x's file-locking support, they also don't work
370 in Win9x.</p>
372 <p>To reiterate, the Subversion client can be run on any platform
373 where APR runs. The Subversion server can also be run on any
374 platform where APR runs, but cannot host a repository on
375 Win95/Win98/WinMe.</p>
377 </div>
380 <div class="h3" id="filesystem" title="filesystem">
381 <h3>What's all this about a new filesystem? Is
382 it like ext2?</h3>
384 <p>No. The "Subversion Filesystem" is not a kernel-level filesystem
385 that one would install in an operating system. Instead, it is
386 Subversion's repository interface, which is a "versioned filesystem"
387 in the sense that it stores a directory tree whose state is remembered
388 from revision to revision. Writing programs to access the repository
389 is similar to writing programs that use other filesystem APIs. The
390 main difference is that this particular filesystem doesn't lose data
391 when written to; old tree states can be retrieved as easily the most
392 recent state.</p>
394 </div>
397 <div class="h3" id="server-requirements" title="server-requirements">
398 <h3>What kind of hardware do I need to run a Subversion server?</h3>
400 <p>Server requirements depend on many factors, such as number of
401 users, frequency of commits and other server related operations,
402 repository size, and the load generated by custom repository hooks.
403 When using Apache, it is likely that Apache itself will be the biggest
404 factor in memory usage. See
405 <a href="http://subversion.tigris.org/servlets/BrowseList?list=users&amp;by=thread&amp;from=330941"
406 >this discussion</a> on the mailing list for some concrete
407 answers.</p>
409 <p>Remember to take in account other applications running on the same
410 server; for example, repository browsers use resources too,
411 independently of Subversion itself.</p>
413 <p>In general, you can expect to need much less server memory than you
414 would for comparable CVS repositories.</p>
416 </div>
419 <div class="h3" id="apache-extension" title="apache-extension">
420 <h3>I heard that Subversion is an Apache
421 extension? What does it use for servers?</h3>
423 <p>No. Subversion is a set of libraries. It comes with a
424 command-line client that uses them. There are two different
425 Subversion server processes: either <b>svnserve</b>, which is small
426 standalone program similar to cvs pserver, or Apache <b>httpd-2.0</b>
427 using a special <b>mod_dav_svn</b> module. <b>svnserve</b> speaks a
428 custom protocol, while <b>mod_dav_svn</b> uses WebDAV as its network
429 protocol. See <a
430 href="http://svnbook.red-bean.com/html-chunk/ch06.html">chapter 6</a>
431 in the Subversion book to learn more.</p>
433 </div>
437 <div class="h3" id="need-apache" title="need-apache">
438 <h3>Does this mean I have to set up Apache to
439 use Subversion?</h3>
441 <p>The short answer: no.</p>
443 <p>The long answer: if you just want to access a repository, then you
444 only need to build a Subversion client. If you want to <b>host</b> a
445 networked repository, then you need to set up either Apache2 or an
446 "svnserve" server.</p>
448 <p>For more details about setting up a network accessible Subversion
449 server, see <a
450 href="http://svnbook.red-bean.com/html-chunk/ch06.html">chapter 6</a>
451 in the Subversion book.</p>
453 </div>
457 <div class="h3" id="multiple-apachim" title="multiple-apachim">
458 <h3>I run Apache 1.x right now, and can't
459 switch to Apache 2.0 just to serve Subversion repositories.
460 Does that mean I can't run a Subversion server?</h3>
462 <p>No, you can run <b>svnserve</b> as a Subversion server. It works
463 extremely well.</p>
465 <p>If you want WebDAV and all the other "goodies" that come with the
466 Apache server, then yes, you'll need Apache 2.0. It's always an
467 option to run Apache 2.0 on a different port while continuing to run
468 Apache 1.x on port 80. Different versions of Apache can happily
469 coexist on the same machine. Just change the <tt>Listen</tt>
470 directive in httpd.conf from "<tt>Listen&nbsp;80</tt>" to
471 "<tt>Listen&nbsp;8080</tt>" or whatever port number you want, and make
472 sure to specify that port when you publish your repository URL (e.g.,
473 <tt>http://svn.mydomain.com:8080/repos/blah/trunk/</tt>).</p>
475 </div>
478 <div class="h3" id="feature-x" title="feature-x">
479 <h3>Why don't you do X, just like SCM system Y?</h3>
481 <p>We aren't attempting to break new ground in SCM systems, nor are we
482 attempting to imitate all the best features of every SCM system out
483 there. We're trying to replace CVS. See the first question.</p>
485 </div>
488 <div class="h3" id="globalrev" title="globalrev">
489 <h3>Why does the entire repository share the
490 same revision number? I want each of my projects to have their
491 own revision numbers.</h3>
493 The global revision number attached to the repository as a whole is
494 meaningless from a user's perspective. It's an internal mechanism that
495 accomplishes the goal of the underlying schema design. It just so
496 happens to be exposed so that the user's interface can sometimes be a
497 little more convenient than always having to type obnoxiously long
498 date/time strings.
499 </p>
502 The revision number is only relevant to the repository, and user
503 convenience. It has <b>no</b> impact on any other factor of what you
504 store in the repository. Repository revision number bumps aren't
505 nearly useful enough to be an accurate indication of the real rate of
506 change of a given code base. There are other more complicated ways to
507 get a much better picture of a code-base's rate of change.
508 </p>
510 </div>
513 <div class="h3" id="changesets" title="changesets">
514 <h3>Does Subversion have Changesets?</h3>
516 <p>The question is a bit loaded, because everyone seems to have a
517 slightly different definition of "changeset", or a least a slightly
518 different expectation of what it means for a version control system to
519 have "changeset features".</p>
521 <p>For the purposes of this discussion, here's a simple definition of
522 changeset: it's a collection of changes with a unique name. The
523 changes might include textual edits to file contents, modifications to
524 tree structure, or tweaks to metadata. In more common speak, a
525 changeset is just a patch with a name you can refer to.</p>
527 <p>Subversion manages versioned trees as first order objects (the
528 repository is an array of trees), and the changesets are things that
529 are derived (by comparing adjacent trees.) Systems like Arch or
530 Bitkeeper are built the other way around: they're designed to manage
531 changesets as first order objects (the repository is a bag of
532 patches), and trees are derived by composing sets of patches
533 together.</p>
535 <p>Neither philosophy is better in absolute terms: the debate goes
536 back at least 30 years. The two designs are better or worse for
537 different types of software development. We're not going to discuss
538 that here. Instead, here's an explanation of what you can do with
539 Subversion.</p>
541 <p>In Subversion, a global revision number 'N' names a tree in the
542 repository: it's the way the repository looked after the Nth commit.
543 It's also the name of an implicit changeset: if you compare tree N
544 with tree N-1, you can derive the exact patch that was committed.</p>
546 <p>For this reason, it's easy to think of "revision N" as not just a
547 tree, but a changeset as well. If you use an issue tracker to manage
548 bugs, you can use the revision numbers to refer to particular patches
549 that fix bugs -- for example, "this issue was fixed by revision 9238."
550 Somebody can then run 'svn log -r9238' to read about the exact
551 changeset which fixed the bug, and run 'svn diff -r9237:9238' to see
552 the patch itself. And svn's merge command also uses revision numbers.
553 You can merge specific changesets from one branch to another by naming
554 them in the merge arguments: 'svn merge -r9237:9238 branchURL' would
555 merge changeset #9238 into your working copy.</p>
557 <p>This is nowhere near as complicated as a system built around
558 changesets as primary objects, but it's still a vast convenience over
559 CVS.</p>
561 </div>
564 <div class="h3" id="release" title="release">
565 <h3>When's the next release?</h3>
567 <p>See our status page, <a
568 href="http://subversion.tigris.org/project_status.html">
569 http://subversion.tigris.org/project_status.html</a>.</p>
571 </div>
574 <div class="h3" id="symlinks" title="symlinks">
575 <h3>Does Subversion support symlinks?</h3>
577 <p>Subversion 1.1 (and later) has the ability to put a symlink under
578 version control, via the usual <tt>svn add</tt> command.</p>
580 <p>Details: the Subversion repository has no internal concept of a
581 symlink. It stores a "versioned symlink" as an ordinary file with an
582 'svn:special' property attached. The svn client (on unix) sees the
583 property and translates the file into a symlink in the working copy.
584 Win32 has no symlinks, so a win32 client won't do any such
585 translation: the object appears as a normal file.</p>
587 </div>
590 <div class="h3" id="logo" title="logo">
591 <h3>I need a high resolution version of the Subversion logo,
592 where can I get it?</h3>
594 <p>Vectorized versions of the Subversion logo are available in the <a
595 href="http://svn.collab.net/repos/svn/trunk/www">logo directory of the www
596 tree</a> of the <a href="http://svn.collab.net/repos/svn/trunk">Subversion
597 repository</a>.</p>
599 <p>Specifically, an <a
600 href="http://svn.collab.net/repos/svn/trunk/www/logo/subversion_logo.eps">EPS
601 version</a>, as well as an <a
602 href="http://svn.collab.net/repos/svn/trunk/www/logo/subversion_logo.ai">Adobe
603 Illustrator document</a> are available.</p>
605 </div>
608 <div class="h3" id="more-information" title="more-information">
609 <h3>I have other questions. Where can I get more information?</h3>
611 <p>If you don't find an answer after browsing this FAQ, there are several
612 other resources available:</p>
613 <ul>
614 <li><a href="http://svnbook.red-bean.com">The Subversion Book</a></li>
615 <li><a href="http://subversion.tigris.org/servlets/ProjectMailingListList">The
616 Subversion Users mailing list</a> (<a
617 href="mailto:users@subversion.tigris.org"
618 >users@subversion.tigris.org</a>)
619 &mdash; note that the list is <a href="#moderation">moderated</a>, so
620 there may be a delay before your post shows up</li>
621 <li><a href="http://svn.haxx.se/users/">The Subversion Users list
622 archives</a></li>
623 <li>IRC on channel #svn on irc.freenode.net</li>
624 <li><a href="http://www.svnforum.org/">svnforum.org</a>, an unofficial
625 web-based forum with approximately the same target audience as the mailing
626 list</li>
627 </ul>
629 </div>
632 <div class="h3" id="moderation" title="moderation">
633 <h3>Why isn't my post showing up on the mailing list?</h3>
635 <p>Our mailing lists are moderated to prevent spam from getting
636 through, so your first post to any list may be delayed, until the
637 moderator has a chance to let it through. Once that post is allowed
638 through, all subsequent posts from the same address are automatically
639 approved, so you should experience no more delay. Of course, if your
640 sending address changes, then you'll have to go through moderation
641 again.</p>
643 </div>
646 </div>
648 <div class="h2" id="how-to" title="how-to">
649 <h2>How-to:</h2>
650 <p/>
653 <div class="h3" id="co-svn" title="co-svn">
654 <h3>How do I check out the Subversion code?</h3>
655 <p>Use the Subversion client:</p>
656 <pre>
657 $ svn co http://svn.collab.net/repos/svn/trunk subversion
658 </pre>
659 <p>That will check out a copy of the Subversion source tree into a
660 directory named subversion on your local machine.</p>
662 </div>
665 <div class="h3" id="repository" title="repository">
666 <h3>How do I create a repository? How do I
667 import data into it?</h3>
669 <p>See <a
670 href="http://svn.collab.net/repos/svn/trunk/README">
671 http://svn.collab.net/repos/svn/trunk/README</a>; specifically, look
672 at section IV, the "Quickstart Guide".</p>
674 <p>For even more detail, read chapter 5 in <a
675 href="http://svnbook.red-bean.com">The Subversion Book</a>.</p>
677 </div>
681 <div class="h3" id="cvs2svn" title="cvs2svn">
682 <h3>How do I convert an existing CVS repository
683 into a Subversion repository?</h3>
685 <p>Try the cvs2svn conversion tool, from <a
686 href="http://cvs2svn.tigris.org/">http://cvs2svn.tigris.org/</a> (see
687 also its <a href="http://cvs2svn.tigris.org/features.html" >feature
688 list</a> and <a href="http://cvs2svn.tigris.org/cvs2svn.html"
689 >documentation</a>). cvs2svn seems to be what most people use, but if
690 for some reason it doesn't meet your needs, there are at least two
691 other tools you could try:</p>
693 <ul>
695 <li>One based on <a
696 href="http://public.perforce.com/public/revml/index.html">VCP</a>
697 written by Chia-liang Kao can be found on <a
698 href="http://search.cpan.org/perldoc?VCP::Dest::svk">CPAN</a>.</li>
700 <li>refinecvs written by Lev Serebryakov is at <a
701 href="http://lev.serebryakov.spb.ru/refinecvs/"
702 >http://lev.serebryakov.spb.ru/refinecvs/</a>.</li>
704 </ul>
706 <p>See also the <a href="links.html">Subversion links</a>
707 page.</p>
709 </div>
713 <div class="h3" id="proxy" title="proxy">
714 <h3>What if I'm behind a proxy?</h3>
716 <p>The Subversion client can go through a proxy, if you configure it
717 to do so. First, edit your "servers" configuration file
718 to indicate which proxy to use. The files location depends on your
719 operating system. On Linux or Unix it is located in the directory
720 "~/.subversion". On Windows it is in "%APPDATA%\Subversion". (Try
721 "echo %APPDATA%", note this is a hidden directory.)</p>
723 <p>There are comments in the file explaining what to do. If you don't
724 have that file, get the latest Subversion client and run any command;
725 this will cause the configuration directory and template files to be
726 created.</p>
728 <p>Next, you need to make sure the proxy server itself supports all
729 the HTTP methods Subversion uses. Some proxy servers do not support
730 these methods by default: PROPFIND, REPORT, MERGE, MKACTIVITY,
731 CHECKOUT. In general, solving this depends on the particular proxy
732 software. For Squid, the config option is</p>
734 <pre>
735 # TAG: extension_methods
736 # Squid only knows about standardized HTTP request methods.
737 # You can add up to 20 additional "extension" methods here.
739 #Default:
740 # none
741 extension_methods REPORT MERGE MKACTIVITY CHECKOUT
742 </pre>
744 <p>(Squid 2.4 and later already knows about PROPFIND.)</p>
746 <p>See also "<a href="#http-methods">What are all the HTTP methods
747 Subversion uses?</a>" for advice on additional HTTP methods to allow
748 through your proxy.</p>
750 <p>If it's difficult or impossible to get the proxy to allow
751 Subversion traffic, but you want to check out the Subversion sources,
752 you may be able to go around the proxy. Some proxies that filter port
753 80 nevertheless allow anything on port 81. For this reason, the
754 <tt>svn.collab.net</tt> repository server listens on port 81 as well
755 as on port 80. Try:</p>
757 <pre>
758 svn checkout http://svn.collab.net:81/repos/svn/trunk subversion
759 </pre>
761 <p>and maybe the proxy will let you through. Another strategy is to
762 attempt the checkout over SSL, which many proxies allow:</p>
764 <pre>
765 svn checkout https://svn.collab.net/repos/svn/trunk subversion
766 </pre>
768 <p>Of course, your svn client will have to have been built with ssl
769 support; just pass <tt>--with-ssl</tt> to Subversion's
770 <tt>./configure</tt> script. You can check to see whether the 'https'
771 scheme is supported by running <tt>svn --version</tt>.</p>
773 </div>
776 <div class="h3" id="paranoid" title="paranoid">
777 <h3>My admins don't want me to have a HTTP server for
778 Subversion. What can I do if I still want remote usage?</h3>
780 <p>A simple option is to use the <b>svnserve</b> server instead of
781 Apache. See <a
782 href="http://svnbook.red-bean.com/html-chunk/ch06.html">chapter 6</a>
783 in the Subversion book for details.</p>
785 <p>However, if your admins don't want you to run Apache, it's very
786 likely they don't want you to run a custom server process on port 3690
787 either! So the rest of this answer assumes that your admins
788 <i>are</i> okay with you using an existing SSH infrastructure.</p>
790 <p>If you previously used CVS, you may have used SSH to login to the
791 CVS server. The ra_svn Subversion access method is the equivalent way
792 of doing this with Subversion. Just use the "svn+ssh" prefix to your
793 Subversion repository URL.</p>
794 <pre>
795 $ svn checkout svn+ssh://your.domain.com/full/path/to/repository
796 </pre>
798 <p>This makes your SSH program launch a private 'svnserve' process on
799 the remote box, which accesses the repository as your UID and tunnels
800 the information back over the encrypted link.</p>
802 <p>However, another solution that can be used instead is to leverage
803 SSH port forwarding to connect to the protected server via ra_dav.
804 You would connect via SSH to a machine behind your firewall that can
805 access your Subversion server. Note that this SSH server does
806 <b>not</b> have to be the same as where Subversion is installed. It
807 can be, but it doesn't have to be.</p>
809 <p>Then, you create a local port forward that connects to the HTTP
810 server that houses your Subversion repository. You would then
811 'connect' to the Subversion repository via this local port. Then,
812 the request will be sent 'tunneled' via SSH server to your Subversion
813 server.</p>
815 <p>An example: a Subversion ra_dav setup is behind your company firewall
816 at 10.1.1.50 (call it svn-server.example.com). Your company allows SSH
817 access via publicly accessible ssh-server.example.com. Internally, you
818 can access the Subversion repository via
819 http://svn-server.example.com/repos/ours.</p>
821 <p><i>Example</i>: client connecting to ssh-server with port-forwarding
822 and checking out via the port forward</p>
824 <pre>
825 % ssh -L 8888:svn-server.example.com:80 me@ssh-server.example.com
826 % svn checkout http://localhost:8888/repos/ours
827 </pre>
829 <p>Note that your svn-server.example.com could also have its httpd
830 instance running on an unprivileged port by a non-trusted user. This
831 will allow your Subversion server not to require root access.</p>
833 <!-- Can you use svn switch to switch your WC between your internal and
834 external Subversion server? I think so. -->
836 <p>Joe Orton notes</p>
837 <pre>
838 The server is sensitive to the hostname used in the Destination header
839 in MOVE and COPY requests, so you have to be a little careful here - a
840 "ServerAlias localhost" may be required to get this working properly.
841 </pre>
843 <p>Some links on SSH port forwarding</p>
845 <ul>
846 <li><a href="http://www.onlamp.com/pub/a/onlamp/excerpt/ssh_11/index3.html"
847 >http://www.onlamp.com/pub/a/onlamp/excerpt/ssh_11/index3.html</a></li>
848 <li><a href="http://csociety.ecn.purdue.edu/~sigos/projects/ssh/forwarding/"
849 >http://csociety.ecn.purdue.edu/~sigos/projects/ssh/forwarding/</a></li>
850 <li><a href="http://www.zip.com.au/~roca/ttssh.html">TTSSH: A Win32 SSH client capable of port forwarding</a></li>
851 </ul>
853 </div>
856 <div class="h3" id="multi-proj" title="multi-proj">
857 <h3>How do I manage several different projects under Subversion?</h3>
859 <p>It depends upon the projects involved. If the projects are
860 related, and are likely to share data, then it's best to create one
861 repository with several subdirectories like this:</p>
862 <pre>
863 $ svnadmin create /repo/svn
864 $ svn mkdir file:///repo/svn/projA
865 $ svn mkdir file:///repo/svn/projB
866 $ svn mkdir file:///repo/svn/projC
867 </pre>
869 <p>If the projects are completely unrelated, and not likely to share data
870 between them, then it's probably best to create separate and unrelated
871 repositories.</p>
872 <pre>
873 $ mkdir /repo/svn
874 $ svnadmin create /repo/svn/projA
875 $ svnadmin create /repo/svn/projB
876 $ svnadmin create /repo/svn/projC
877 </pre>
879 The difference between these two approaches is this (as explained by
880 Ben Collins-Sussman &lt;sussman@collab.net&gt;):</p>
882 <ul>
883 <li>
884 In the first case, code can easily be copied or moved around
885 between projects, and the history is preserved. ('svn cp/mv'
886 currently only works within a single repository.)
887 </li>
888 <li>
889 Because revision numbers are repository-wide, a commit to any
890 project in the first case causes a global revision bump. So it
891 might seem a bit odd if somebody has 'projB' checked out, notices
892 that 10 revisions have happened, but projB hasn't changed at
893 all. Not a big deal, really. Just a little weird at first.
894 This used to happen to svn everytime people committed to
895 rapidsvn, when rapidsvn was in the same repository. :-)
896 </li>
897 <li>
898 The second case might be easier to secure; it's easier to insulate
899 projects from each other (in terms of users and permissions)
900 using Apache's access control. In the 1st case, you'll need a
901 fancy hook script in the repository that distinguishes projects
902 ("is this user allowed to commit to this particular subdir?") Of
903 course, we already have such a script, ready for you to use.
904 </li>
905 </ul>
907 </div>
910 <div class="h3" id="multi-merge" title="multi-merge">
911 <h3>How do I merge two completely separate repositories?</h3>
913 <p>If you don't care about retaining all the history of one of the
914 repositories, you can just create a new directory under one project's
915 repository, then import the other.</p>
917 <p>If you care about retaining the history of both, then you can use
918 'svnadmin dump' to dump one repository, and 'svnadmin load' to load it into
919 the other repository. The revision numbers will be off, but you'll
920 still have the history.</p>
922 <p>Peter Davis &lt;peter@pdavis.cx&gt; also explains a method using svn's
923 equivalent to CVS modules:</p>
925 <blockquote>
926 <p>As long as the merging takes place in separate directory
927 trees, you can use svn's version of CVS modules.</p>
929 <p>Set the <em>svn:externals</em> property on a directory to checkout
930 directories from other repositories whenever the original
931 directory is checked out. The repository remains separate,
932 but in the working copy it appears that they have been merged.
933 If you commit to the imported directory, it will affect the
934 external repository.</p>
936 <p>The merge isn't completely clean: the import only affects
937 working copies, so you won't be able to use a URL in the first
938 repository to access modules imported from the second. They
939 remain separate URLs.</p>
940 </blockquote>
942 <p>See also <a href="links.html#misc_utils">miscellaneous utilities</a>
943 for helpful tools to select and reorder revisions when merging
944 several repositories, especially the
945 <a href="http://www.coelho.net/svn-merge-repos.html">svn-merge-repos.pl</a>
946 perl script for basic operations and the
947 <a href="http://svn.borg.ch/svndumptool/">SvnDumpTool</a> python classes
948 for advanced reorganisations.</p>
949 </div>
953 <div class="h3" id="nfs" title="nfs">
954 <h3>Should I store my repository / working copy on a NFS
955 server?</h3>
957 <p>If you are using a repository with the Berkeley DB back end
958 (default for repositories created with Subversion 1.0 and 1.1, not the
959 default thereafter), we recommend <i>not</i> storing the repository on
960 a remote filesystem (for example, NFS). While Berkeley DB databases
961 and log files can be stored on remote filesystems, the Berkeley DB
962 shared region files cannot be stored on a remote filesystem, so the
963 repository may be safely accessed by only a single filesystem client,
964 and not all Subversion functionality will be available to even that
965 one client.</p>
967 <p>If you are using the <a
968 href="http://svn.collab.net/repos/svn/trunk/notes/fsfs">FSFS</a>
969 repository back end, then storing the repository on a modern NFS
970 server (i.e., one that supports locking) should be fine.</p>
972 <p>Working copies can be stored on NFS (one common scenario is when
973 your home directory is on a NFS server). On Linux NFS servers, due to
974 the volume of renames used internally in Subversion when checking out
975 files, some users have reported that 'subtree checking' should be
976 disabled (it's enabled by default). Please see <a
977 href="http://nfs.sourceforge.net/nfs-howto/server.html" >NFS Howto
978 Server Guide</a> and <b>exports(5)</b> for more information on how to
979 disable subtree checking.</p>
981 <p>We've had at least one report of working copies getting wedged
982 after being accessed via SMB. The server in question was running a
983 rather old version of Samba (2.2.7a). The problem didn't recur with a
984 newer Samba (3.0.6).</p>
986 </div>
989 <div class="h3" id="bdblogs" title="bdblogs">
990 <h3>Why is my repository taking up so much disk space?</h3>
992 <p>The repository stores all your data in a Berkeley DB "environment"
993 in the repos/db/ subdirectory. The environment contains a collection
994 of tables and bunch of logfiles (log.*). Berkeley DB journals all
995 changes made to the tables, so that the tables can be recovered to a
996 consistent state in case of interruptions (<a
997 href="#bdb-recovery">more info</a>).</p>
999 <p>The logfiles will grow forever, eating up disk space, unless you,
1000 (as the repository administrator) do something about it. At any given
1001 moment, Berkeley DB is only using a few logfiles actively (see <a
1002 href="http://subversion.tigris.org/servlets/ReadMsg?list=users&amp;msgNo=15194"
1003 >this post</a> and its associated thread); the rest can be safely
1004 deleted. If you keep all the logfiles around forever, then in theory
1005 Berkeley DB can replay every change to your repository from the day it
1006 was born. But in practice, if you're making backups, it's probably
1007 not worth the cost in disk space.</p>
1009 <p>Use <code>svnadmin</code> to see
1010 which log files can be deleted. You may want a cron job to do this.</p>
1012 <pre>
1013 $ svnadmin list-unused-dblogs /repos
1014 /repos/db/log.000003
1015 /repos/db/log.000004
1016 [...]
1018 $ svnadmin list-unused-dblogs /repos | xargs rm
1019 # disk space reclaimed!
1020 </pre>
1022 <p>You could instead use Berkeley DB's <code>db_archive</code> command:</p>
1024 <pre>
1025 $ db_archive -a -h /repos/db | xargs rm
1026 # disk space reclaimed!
1027 </pre>
1029 <p>See also <code>svnadmin hotcopy</code> or <code>hotbackup.py</code>.</p>
1031 <p><strong>Note:</strong> If you use Berkeley DB 4.2, Subversion will
1032 create new repositories with automatic log file removal enabled. You
1033 can change this by passing the <code>--bdb-log-keep</code> option to
1034 <code>svnadmin create</code>. Refer to the section about the <a
1035 href="http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_set_flags.html#DB_LOG_AUTOREMOVE">
1036 <code>DB_LOG_AUTOREMOVE</code></a> flag in the Berkeley DB manual.</p>
1038 </div>
1041 <div class="h3" id="reposperms" title="reposperms">
1042 <h3>How do I set repository
1043 permissions correctly?</h3>
1045 <p>Try to have as <em>few</em> users access the repository as
1046 possible. For example, run apache or 'svnserve -d' as a specific
1047 user, and make the repository wholly owned by that user. Don't allow
1048 any other users to access the repository via <tt>file:///</tt> urls,
1049 and be sure to run 'svnlook' and 'svnadmin' only as the user which
1050 owns the repository.</p>
1052 <p>If your clients are accessing via <tt>file:///</tt> or
1053 <tt>svn+ssh://</tt>, then there's no way to avoid access by multiple
1054 users. In that case, read <a
1055 href="http://svnbook.red-bean.com/html-chunk/ch06s05.html">the last
1056 section in chapter 6</a>, and pay particular attention to the
1057 "checklist" sidebar at the bottom. It outlines a number of steps to
1058 make this scenario safer.</p>
1060 <b>Note for SELinux / Fedora Core 3+ / Red Hat Enterprise users:</b>
1062 <p>In addition to regular Unix permissions, under SELinux every file,
1063 directory, process, etc. has a 'security context'. When a process
1064 attempts to access a file, besides checking the Unix permissions the
1065 system also checks to see if the security context of the process is
1066 compatible with the security context of the file.</p>
1068 <p>Fedora Core 3, among other systems, comes with SELinux installed by
1069 default, configured so that Apache runs in a fairly restricted
1070 security context. To run Subversion under Apache, you have to set the
1071 security context of the repository to allow Apache access (or turn off
1072 the restrictions on Apache, if you think all this is overkill). The
1073 <tt>chcon</tt> command is used to set the security context of files
1074 (similarly to how the <tt>chmod</tt> sets the traditional Unix
1075 permissions). For example, one user had to issue this command</p>
1077 <pre> $ chcon -R -h -t httpd_sys_content_t <i>PATH_TO_REPOSITORY</i></pre>
1079 <p>to set the security context to be able to successfully
1080 access the repository.</p>
1082 </div>
1086 <div class="h3" id="readonly" title="readonly">
1087 <h3>Why do read-only operations still need repository
1088 write access?</h3>
1090 <p>Certain client operations are "read-only", like checkouts and
1091 updates. From an access-control standpoint, Apache treats them as
1092 such. But libsvn_fs (the repository filesystem API) still has to
1093 write temporary data in order to produce tree-deltas. So the process
1094 accessing the repository always requires both read <em>and</em> write
1095 access to the Berkeley DB files in order to function.</p>
1097 <p>In particular, the repository responds to many "read-only"
1098 operations by comparing two trees. One tree is the usually the HEAD
1099 revision, and the other is often a temporary transaction-tree -- thus
1100 the need for write access.</p>
1102 <p>This limitation only applies to the Berkeley DB backend; the <a
1103 href="http://svnbook.red-bean.com/svnbook-1.1/ch05.html#svn-ch-5-sect-1.2.A">FSFS
1104 backend</a> does not exhibit this behaviour.</p>
1106 </div>
1109 <div class="h3" id="removal" title="removal">
1110 <h3>
1111 How do I completely remove a file from the repository's history?
1112 </h3>
1114 <p>There are special cases where you might want to destroy all
1115 evidence of a file or commit. (Perhaps somebody accidentally committed
1116 a confidential document.) This isn't so easy, because Subversion is
1117 deliberately designed to never lose information. Revisions are
1118 immutable trees which build upon one another. Removing a revision from
1119 history would cause a domino effect, creating chaos in all subsequent
1120 revisions and possibly invalidating all working copies.</p>
1122 <p>The project has plans, however, to someday implement an <b>svnadmin
1123 obliterate</b> command which would accomplish the task of permanently
1124 deleting information. (See <a
1125 href="http://subversion.tigris.org/issues/show_bug.cgi?id=516">issue
1126 516</a>.)</p>
1128 <p>In the meantime, your only recourse is to <b>svnadmin dump</b> your
1129 repository, then pipe the dumpfile through <b>svndumpfilter</b>
1130 (excluding the bad path) into an <b>svnadmin load</b> command. See <a
1131 href="http://svnbook.red-bean.com/html-chunk/ch05.html">chapter 5</a>
1132 of the Subversion book for details about this.</p>
1134 </div>
1137 <div class="h3" id="change-log-msg" title="change-log-msg">
1138 <h3>
1139 How do I change the log message for a revision after it's been committed?
1140 </h3>
1142 <p>Log messages are kept in the repository as properties attached to each
1143 revision. By default, the log message property (<em>svn:log</em>) cannot be
1144 edited once it is committed. That is because changes to <a
1145 href="http://svnbook.red-bean.com/svnbook/ch05.html#svn-ch-5-sect-1.2">revision
1146 properties</a> (of which <em>svn:log</em> is one) cause the property's
1147 previous value to be permanently discarded, and Subversion tries to prevent
1148 you from doing this accidentally. However, there are a couple of ways to get
1149 Subversion to change a revision property.</p>
1151 <p>The first way is for the repository administrator to enable revision
1152 property modifications. This is done by creating a hook called
1153 "pre-revprop-change" (see <a
1154 href="http://svnbook.red-bean.com/svnbook/ch05s02.html#svn-ch-5-sect-2.1">this
1155 section</a> in the Subversion book for more details about how to do this).
1156 The "pre-revprop-change" hook has access to the old log message before it is
1157 changed, so it can preserve it in some way (for example, by sending an email).
1158 Once revision property modifications are enabled, you can change a revision's
1159 log message by passing the --revprop switch to <b>svn propedit</b> or <b>svn
1160 propset</b>, like either one of these:</p>
1162 <pre>
1163 $ svn propedit -r N --revprop svn:log URL
1164 $ svn propset -r N --revprop svn:log "new log message" URL
1165 </pre>
1167 <p>where N is the revision number whose log message you wish to change, and
1168 URL is the location of the repository. If you run this command from within a
1169 working copy, you can leave off the URL.</p>
1171 <p>The second way of changing a log message is to use <b>svnadmin setlog</b>.
1172 This must be done by referring to the repository's location on the filesystem.
1173 You cannot modify a remote repository using this command.</p>
1175 <pre>
1176 $ svnadmin setlog REPOS_PATH -r N FILE
1177 </pre>
1179 <p>where REPOS_PATH is the repository location, N is the revision number whose
1180 log message you wish to change, and FILE is a file containing the new log
1181 message. If the "pre-revprop-change" hook is not in place (or you want to
1182 bypass the hook script for some reason), you can also use the --bypass-hooks
1183 option. However, if you decide to use this option, be very careful. You may
1184 be bypassing such things as email notifications of the change, or backup
1185 systems that keep track of revision properties.</p>
1187 </div>
1190 <div class="h3" id="patch" title="patch">
1191 <h3>How do I submit a patch for Subversion?</h3>
1193 <p>FIRST, read the <a href="hacking.html">Hacker's Guide to
1194 Subversion</a>.</p>
1196 <p>Once you've digested that, send a mail to the dev list with the
1197 word [PATCH] and a one-line description in the subject, and include
1198 the patch inline in your mail (unless your MUA munges it up
1199 totally). Then a committer will pick it up, apply it (making any
1200 formatting or content changes necessary), and check it in.</p>
1202 <p>The basic process looks like this:</p>
1204 <blockquote><pre>
1205 $ svn co http://svn.collab.net/repos/svn/trunk subversion
1206 $ cd subversion/www
1208 [ make changes to faq.html ]
1210 $ svn diff faq.html &gt; /tmp/foo
1212 $ Mail -s "[PATCH] FAQ updates" &lt; /tmp/foo
1213 </pre></blockquote>
1215 <p>Of course, the email you send should contain a nice long
1216 explanation about what the patch does, as per the
1217 <a href="hacking.html">Hacker's Guide to Subversion</a>, but you
1218 already know that, since you read and completely understood
1219 it <em>before</em> actually hacking the code, right? :)</p>
1221 </div>
1224 <div class="h3" id="in-place-import" title="in-place-import">
1225 <h3>How can I do an in-place 'import'
1226 (i.e. add a tree to Subversion such that the original data becomes
1227 a working copy directly)?</h3>
1229 <p>Suppose, for example, that you wanted to put some of /etc under
1230 version control inside your repository:</p>
1232 <pre>
1233 # svn mkdir file:///root/svn-repository/etc \
1234 -m "Make a directory in the repository to correspond to /etc"
1235 # cd /etc
1236 # svn checkout file:///root/svn-repository/etc .
1237 # svn add apache samba alsa X11
1238 # svn commit -m "Initial version of my config files"
1239 </pre>
1241 <p>This takes advantage of a not-immediately-obvious feature of
1242 <tt>svn&nbsp;checkout</tt>: you can check out a directory from the repository
1243 directly into an existing directory. Here, we first make a new empty directory
1244 in the repository, and then check it out into <tt>/etc</tt>, transforming
1245 <tt>/etc</tt> into a working copy. Once that is done, you can use normal
1246 <tt>svn&nbsp;add</tt> commands to select files and subtrees to add to the
1247 repository.</p>
1249 <p>There is an issue filed for enhancing <tt>svn&nbsp;import</tt> to
1250 be able to convert the imported tree to a working copy automatically;
1251 see <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=1328"
1252 >issue 1328</a>.</p>
1254 </div>
1257 <div class="h3" id="dumpload" title="dumpload">
1258 <h3>What is this "dump/load cycle" people
1259 sometimes talk about when upgrading a Subversion server?</h3>
1261 <p>Subversion's repository database schema has changed occasionally
1262 during development. Old repositories, created with a pre-1.0
1263 development version of Subversion, may require the following operation
1264 when upgrading. If a schema change happens between Subversion
1265 releases X and Y, then repository administrators upgrading to Y must
1266 do the following: </p>
1268 <ol>
1269 <li>Shut down svnserve, Apache, and anything else that might be
1270 accessing the repository.
1271 </li>
1273 <li>
1275 <tt>svnadmin&nbsp;dump&nbsp;/path/to/repository&nbsp;>&nbsp;dumpfile.txt</tt>
1276 </b>,
1277 using version X of svnadmin.
1278 </li>
1280 <li>
1282 <tt>mv&nbsp;/path/to/repository&nbsp;/path/to/saved-old-repository</tt>
1283 </b>
1284 </li>
1286 <li>Now upgrade to Subversion Y (i.e., build and install Y, replacing X).
1287 </li>
1289 <li>
1290 <b><tt>svnadmin&nbsp;create&nbsp;/path/to/repository</tt></b>, using version
1291 Y of svnadmin.
1292 </li>
1294 <li>
1296 <tt>svnadmin&nbsp;load&nbsp;/path/to/repository&nbsp;&lt;&nbsp;dumpfile.txt</tt>
1297 </b>,
1298 again using version Y of svnadmin.
1299 </li>
1301 <li>Copy over hook scripts, etc, from the old repository to the new one.
1302 </li>
1304 <li>Restart svnserve, Apache, etc.
1305 </li>
1306 </ol>
1308 <p> See
1309 <a href="http://svnbook.red-bean.com/html-chunk/ch05s03.html#svn-ch-5-sect-3.4"
1310 >http://svnbook.red-bean.com/html-chunk/ch05s03.html#svn-ch-5-sect-3.4</a>
1311 for more details on dumping and loading.</p>
1313 <p> <b>Note</b>: Most upgrades of Subversion do <i>not</i> involve a
1314 dump and load. When one is required, the release announcement and the
1315 CHANGES file for the new version will carry prominent notices about
1316 it. If you don't see such a notice, then there has been no schema
1317 change, and no dump/load is necessary. </p>
1319 </div>
1322 <div class="h3" id="sspi" title="sspi">
1323 <h3>How do I allow clients to authenticate against a
1324 Windows domain controller using SSPI authentication?</h3>
1326 <p><a href="http://tortoisesvn.tigris.org">TortoiseSVN</a> has an excellent
1327 document that describes setting up a Subversion server on Windows. Go to
1328 <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup.html#tsvn-serversetup-apache-5"
1329 >http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup.html#tsvn-serversetup-apache-5</a>,
1330 to see the section on SSPI authentication.</p>
1332 <p>An important part of the configuration is the line:</p>
1333 <pre>
1334 SSPIOfferBasic On
1335 </pre>
1337 <p>Without this line, browsers that support SSPI will prompt for the user's
1338 credentials, but clients that do not suppport SSPI such as Subversion
1339 will not prompt. (The current release of Neon - Subversion's HTTP
1340 library - handles only basic authentication.) Because the client never
1341 asks for credentials, any action that requires authentication will fail.
1342 Adding this line tells <tt>mod_auth_sspi</tt> to use basic authentication with
1343 the client, but to use the Windows domain controller to authenticate
1344 the credentials.</p>
1346 </div>
1349 <div class="h3" id="adm-dir" title="adm-dir">
1350 <h3>I don't like the ".svn" directory name, and
1351 prefer "SVN" or something else. How do I change it?</h3>
1353 <p>We recommend that you live with ".svn" if you possibly can.
1354 However, if you are using ASP.NET under Windows, you might need to set
1355 the environment variable SVN_ASP_DOT_NET_HACK, as
1356 described <a href="#vs-asp-net">here</a>.</p>
1358 <p>Or you could use a completely custom name for the administrative
1359 directory. We recommend against this, because your working copy would
1360 probably not work with Subversion clients other than the one you
1361 customized. However, if you absolutely must do this, just change this
1362 line in <tt>subversion/include/svn_wc.h</tt> from</p>
1364 <pre>
1365 #define SVN_WC_ADM_DIR_NAME ".svn"
1366 </pre>
1369 to (for example)
1370 </p>
1372 <pre>
1373 #define SVN_WC_ADM_DIR_NAME "SVN"
1374 </pre>
1377 then recompile your client.
1378 </p>
1380 </div>
1383 <div class="h3" id="case-change" title="case-change">
1384 <h3>How do I change the case of a filename?</h3>
1386 <p>This problem comes up in two situations. If you're adding files on
1387 an operating system with a case-insensitive filesystem, such as
1388 Windows, you might find you accidentally add a file with the wrong
1389 case in the filename. Alternatively, you may just decide to change
1390 the case of an existing file in the repository.</p>
1392 <p>If you're working in a case-sensitive file system, this is no
1393 problem at all. Just move the file to the new name, e.g.,</p>
1395 <pre>
1396 svn&nbsp;mv&nbsp;file.java&nbsp;File.java
1397 </pre>
1399 <p>But this won't work in a case-insensitive operating system like
1400 Windows. In Windows you can accomplish this by copying the file
1401 somewhere temporary, deleting the file from Subversion, then adding
1402 the copy with the correct case. Or a better way is to perform a move
1403 operation with Subversion URLs. Using URLs is recommended, because it
1404 will preserve history for the file, and will take effect
1405 immediately.</p>
1407 <p>Both ways will leave Windows working copies with problems, however,
1408 because Windows can still get confused when trying to update the
1409 conflicting filenames. (You'll get a message like <tt>svn: Failed to
1410 add file 'File.java': object of the same name already
1411 exists</tt>). One way of fixing the problem is to delete your working
1412 copy and check out again. If you do not want to do this, you must
1413 perform a two step update.</p>
1415 <p>For each file with the wrong case, the following command will change
1416 the case:</p>
1418 <pre>
1419 svn mv svn://svnserver/path/to/file.java svn://svnserver/path/to/File.java
1420 </pre>
1422 <p>To update the working copy, change to the relevant directory and do:</p>
1424 <pre>
1425 svn update file.java
1426 svn update
1427 </pre>
1429 <p>The first update will remove <tt>file.java</tt> from your working
1430 copy, the second update will add <tt>File.java</tt>, leaving you with
1431 a correct working copy. Or if you had a lot of problematic files, you
1432 can update the working copy this way:</p>
1434 <pre>
1435 svn update *
1436 svn update
1437 </pre>
1439 <p>As you can see, adding a file with the wrong case is tricky to fix on
1440 an operating system that has a case insensitive filesystem. Do try to
1441 get it right when you add the file the first time! To prevent the
1442 problem from occurring in the first place, you can create a pre-commit hook that
1443 calls the file <tt>check-case-insensitive.pl</tt>. That file lives
1444 in the Subversion
1445 source tarball, in the directory <tt>contrib/hook-scripts</tt>.</p>
1447 </div>
1450 <div class="h3" id="merge-using-tags" title="merge-using-tags">
1451 <h3>I can't use tags to merge changes from a
1452 branch into the trunk like I used to with CVS, can I?</h3>
1454 <p>As shown below it is possible to merge from a branch to the trunk
1455 without remembering one revision number. Or vice versa (not shown in the
1456 example).</p>
1458 <p>The example below presumes an existing repository in <tt>/home/repos</tt>
1459 in which you want to start a branch named <tt>bar</tt> containing a file
1460 named <tt>foo</tt> you are going to edit.</p>
1462 <p>For the purpose of tracing branch merges, this repository has set up
1463 <tt>tags/branch_traces/</tt> to keep tags.</p>
1465 <pre># setup branch and tags
1466 $ svn copy file:///home/repos/trunk \
1467 file:///home/repos/branches/bar_branch \
1468 -m "start of bar branch"
1469 $ svn copy file:///home/repos/branches/bar_branch \
1470 file:///home/repos/tags/branch_traces/bar_last_merge \
1471 -m "start"
1473 # checkout branch working copy
1474 $ svn checkout file:///home/repos/branches/bar_branch wc
1475 $ cd wc
1477 # edit foo.txt file and commit
1478 $ echo "some text" &gt;&gt;foo.txt
1479 $ svn commit -m "edited foo"
1481 # switch to trunk and merge changes from branch
1482 $ svn switch file:///home/repos/trunk
1483 $ svn merge file:///home/repos/tags/branch_traces/bar_last_merge \
1484 file:///home/repos/branches/bar_branch
1486 # Now check the file content of 'foo.txt', it should contain the changes.
1488 # commit the merge
1489 $ svn commit -m "Merge change X from bar_branch."
1491 # finally, update the trace branch to reflect the new state of things
1492 $ svn delete -m "Remove old trace branch in preparation for refresh." \
1493 file:///home/repos/tags/branch_traces/bar_last_merge
1494 $ svn copy file:///home/repos/branches/bar_branch \
1495 file:///home/repos/tags/branch_traces/bar_last_merge \
1496 -m "Reflect merge of change X."
1497 </pre>
1499 </div>
1502 <div class="h3" id="version-value-in-source" title="version-value-in-source">
1503 <h3>Why doesn't the $Revision$
1504 keyword do what I want? It expands to the file's last-changed revision,
1505 but I want something that will expand to the file's current revision.</h3>
1508 Subversion increments the revision number of the repository as a
1509 whole, so it can't expand any keyword to be that number - it would
1510 have to search and possibly modify every file in your working copy on
1511 every update and commit.
1512 </p>
1515 The information you want (the revision of your working copy) is
1516 available from the command <tt>svnversion</tt>; it gives you
1517 information on the revision level of a working copy given a path (see
1518 <tt>svnversion --help</tt> for details).
1519 </p>
1522 You can incorporate it into your build or release process to get the
1523 information you need into the source itself. For example, in a build
1524 environment based on <tt>GNU&nbsp;make</tt>, add <a
1525 href="http://subversion.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=112564"
1526 >something like this</a> to your <tt>Makefile</tt>:
1527 </p>
1529 <pre>
1531 ## To use this, in yourfile.c do something like this:
1532 ## printf("this program was compiled from SVN revision %s\n",SVN_REV);
1535 SVNDEF := -D'SVN_REV="$(shell svnversion -n .)"'
1536 CFLAGS := $(SVNDEF) ... continue with your other flags ...
1537 </pre>
1540 (Note that this will not work on non-GNU versions of <tt>make</tt>.
1541 Don't use it if your build process needs to be portable.)</p>
1543 <p>Or try this recipe:</p>
1545 <pre>
1547 ## on every build, record the working copy revision string
1549 svn_version.c: FORCE
1550 echo -n 'const char* svn_version(void) { const char* SVN_Version = "' \
1551 &gt; svn_version.c
1552 svnversion -n . &gt;&gt; svn_version.c
1553 echo '"; return SVN_Version; }' &gt;&gt; svn_version.c
1556 ## Then any executable that links in <tt>svn_version.o</tt> will be able
1557 ## to call the function <tt>svn_version()</tt> to get a string that
1558 ## describes exactly what revision was built.
1560 </pre>
1563 Windows users may want to use <tt>SubWCRev.exe</tt>, available from
1564 the <a
1565 href='http://tortoisesvn.net/downloads'>TortoiseSVN
1566 download page</a>; it replaces all <tt>$WCREV$</tt> tags in a given
1567 file with the current working copy revision.
1568 </p>
1570 </div>
1573 <div class="h3" id="log-in-source" title="log-in-source">
1574 <h3>Does Subversion have a keyword which
1575 behaves like $Log$ in CVS?</h3>
1577 <p>No. There is no equivalent for the $Log$ keyword in CVS. If you
1578 want to retrieve a log for a specific file, you can run
1579 'svn log your-file-name' or 'svn log url-to-your-file'.
1580 From the mailing list some explanations why $Log$ is bad:</p>
1582 <pre>"$Log$ is a total horror the moment you start merging changes
1583 between branches. You're practically guaranteed to get conflicts there,
1584 which -- because of the nature of this keyword -- simply cannot be
1585 resolved automatically."</pre>
1587 <p>And:</p>
1589 <pre>Subversion log messages are mutable, they can be changed by setting
1590 the svn:log revision property. So the expansion of $Log:$ in any
1591 given file could be out of date. Update may well need to retrieve the
1592 appropriate log message for each occurrence of the $Log:$ keyword,
1593 even if the file that contained it was not otherwise updated.</pre>
1595 <p><i>I don't care about that. I want to use it anyway.
1596 Will you implement it?</i></p>
1598 <p>No. There are no plans to implement it ourselves or accept patches
1599 which implement this feature. If you want to distribute your files
1600 with some kind of changelog included, you might be able to work
1601 around this limitation in your build system.</p>
1603 </div>
1607 <div class="h3" id="ignore-commit" title="ignore-commit">
1608 <h3>I have a file in my project that every
1609 developer must change, but I don't want those local mods to ever be
1610 committed. How can I make 'svn commit' ignore the file?</h3>
1612 <p>The answer is: don't put that file under version control. Instead,
1613 put a <em>template</em> of the file under version control, something
1614 like "file.tmpl".</p>
1616 <p>Then, after the initial 'svn checkout', have your users (or your
1617 build system) do a normal OS copy of the template to the proper
1618 filename, and have users customize the copy. The file is unversioned,
1619 so it will never be committed. And if you wish, you can add the file
1620 to its parent directory's svn:ignore property, so it doesn't show up
1621 as '?' in the 'svn status' command.</p>
1623 </div>
1626 <div class="h3" id="ssh-auth-cache" title="ssh-auth-cache">
1627 <h3>When I access a repository using
1628 svn+ssh, my password is not cached in ~/.subversion/auth/. How do
1629 I avoid having to type it so often?</h3>
1631 <p>ssh has its own passphrases and its own authentication-caching
1632 scheme. Its auth caching is external to Subversion, and must be set
1633 up independently of Subversion.</p>
1635 <p>OpenSSH includes <b><tt>ssh-keygen</tt></b> to create the keys,
1636 <b><tt>ssh-agent</tt></b> to cache passphrases, and
1637 <b><tt>ssh-add</tt></b> to add passphrases to the agent's cache. A
1638 popular script to simplify usage of <tt>ssh-agent</tt> is
1639 <b><tt>keychain</tt></b>. On Windows, <b><tt>PuTTY</tt></b> is a
1640 popular alternative ssh client; see <b><tt>PuTTYgen</tt></b> to import
1641 OpenSSH keys and <b><tt>pageant</tt></b> to cache passphrases.</p>
1643 <p>Setting up <tt>ssh-agent</tt> is outside the scope of this
1644 document, but a <a
1645 href="http://www.google.com/search?hl=en&amp;lr=&amp;ie=UTF-8&amp;q=%22ssh-agent%22"
1646 >Google search for "ssh-agent"</a> will quickly get you answers. Or
1647 if you're <i>really</i> impatient, try one of these:</p>
1649 <pre>
1650 <a href="http://mah.everybody.org/docs/ssh"
1651 >http://mah.everybody.org/docs/ssh</a>
1652 <a href="http://kimmo.suominen.com/docs/ssh/"
1653 >http://kimmo.suominen.com/docs/ssh/</a>
1654 </pre>
1656 </div>
1659 <div class="h3" id="ssh-svnserve-location" title="ssh-svnserve-location">
1660 <h3>My
1661 <tt>svnserve</tt> binary is in a directory that isn't on my
1662 users' default <tt>PATH</tt>s, they use svn+ssh, and I can't figure
1663 out how to modify their <tt>PATH</tt> so that they can run <tt>svnserve</tt>.</h3>
1665 <p>Note: this all assumes you're using OpenSSH. There are other
1666 ssh implementations out there, and presumably they will allow
1667 you to do something similar, but we don't yet know the details.</p>
1669 <p>You've tried fiddling with their various login files, like
1670 <tt>.bash_profile</tt>, and nothing works! That's because ssh
1671 ignores those files when the Subversion client invokes it.
1672 But there's no need to modify <tt>PATH</tt>; instead, you can
1673 directly give ssh the full name of the <tt>svnserve</tt> command.
1674 Here's how to do it:</p>
1676 <p>For each user who needs svn+ssh access, generate a new ssh
1677 public-key pair which they will use <em>only</em> for
1678 Subversion&mdash;not for logging in normally. Have them give
1679 the keypair a distinctive name, like
1680 <tt>~/.ssh/id_dsa.subversion</tt>. Add the public part of the
1681 key to their <tt>~/.ssh/authorized_keys</tt> file on the
1682 server machine, after first inserting a bit of magic at the
1683 beginning of the line before the word <tt>ssh-rsa</tt> or
1684 <tt>ssh-dss</tt>, like this:</p>
1686 <table border="1" cellspacing="2" cellpadding="2">
1687 <tr><th>before</th></tr>
1688 <tr><td><tt>ssh-dss&nbsp;AAAAB3Nblahblahblahblah</tt></td></tr>
1689 <tr><th>after</th></tr>
1690 <tr><td><tt>
1691 command="/opt/subversion/bin/svnserve&nbsp;-t"&nbsp;ssh-dss&nbsp;AAAAB3Nblahblahblahblah
1692 </tt></td></tr>
1693 </table>
1695 <p>Obviously, replace <tt>/opt/subversion/bin/svnserve</tt> with
1696 whatever is appropriate for your system. You also might want to
1697 specify the full path to the Subversion repository in the
1698 command (by using the <tt>-r</tt> option), to save your users
1699 some typing.</p>
1701 <p>The <tt>command=</tt> magic causes sshd on the remote machine
1702 to invoke <tt>svnserve</tt>, even if your user tries to run
1703 some other command. See the sshd(8) man page (section
1704 <tt>AUTHORIZED_KEYS FILE FORMAT</tt>) for details.</p>
1706 <p>Now when your users run the Subversion client, make sure they
1707 have an <tt>SVN_SSH</tt> environment variable that "points to"
1708 the private half of their keypair, by doing something like this
1709 (for the Bourne Again shell):</p>
1711 <pre>
1712 SVN_SSH="ssh -i $HOME/.ssh/id_dsa.subversion"
1713 export SVN_SSH
1714 </pre>
1716 <p><a
1717 href="http://svn.collab.net/repos/svn/trunk/notes/ssh-tricks">This
1718 file</a> discusses this topic in more detail.</p>
1720 </div>
1723 <div class="h3" id="ssh-authorized-keys-trick" title="ssh-authorized-keys-trick">
1724 <h3>I want to allow access via svn+ssh://, but am paranoid. I hate the
1725 idea of giving each user a login; I would then have to worry about
1726 what they are, and are not, allowed to access on my machine.</h3>
1727 <p>See the section about hacking
1728 the <tt>~/.ssh/authorized_keys</tt> file in the answer
1729 to <a href="#ssh-svnserve-location">this other question</a>; ignore the stuff
1730 about getting <tt>svnserve</tt> on your PATH.</p>
1731 </div>
1734 <div class="h3" id="auto-props" title="auto-props">
1735 <h3>How can I set certain properties on
1736 everything in the repository? Also, how can I make sure that every
1737 new file coming into the repository has these properties?</h3>
1739 <p>Subversion will not change a file's contents by default; you have
1740 to deliberately set the <tt>svn:eol-style</tt> or
1741 <tt>svn:keywords</tt> property on a file for that to happen. That
1742 makes Subversion a lot safer than CVS's default behavior, but with
1743 that safety comes some inconvenience.</p>
1745 <p>Answering the first question: to set properties on all files
1746 already in the repository, you'll need to do it the hard way. All you
1747 can do is run <tt>svn propset</tt> on every file (in a working copy),
1748 and then <tt>svn commit</tt>. Scripting can probably help you with
1749 this.</p>
1751 <p>But what about future files? Unfortunately, there's no server
1752 mechanism to automatically set properties on files being committed.
1753 This means that all of your users need to remember to set certain
1754 properties whenever they <tt>svn add</tt> a file. Fortunately,
1755 there's a client-side tool to help with this. Read about the <a
1756 href="http://svnbook.red-bean.com/svnbook-1.1/ch07s02.html#svn-ch-7-sect-2.4">
1757 auto-props</a> feature in the book. You need to make sure all your
1758 users configure their clients' auto-props settings appropriately.</p>
1760 <p>You could write a pre-commit hook script to reject any commit which
1761 forgets to add properties to new files (see <a
1762 href="http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/check-mime-type.pl"
1763 >http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/check-mime-type.pl</a>
1764 for example). However, this approach may be overkill. If somebody
1765 forgets to set <tt>svn:eol-style</tt>, for example, it will be noticed
1766 the minute somebody else opens the file on a different OS. Once
1767 noticed, it's easy to fix: just set the property and commit.</p>
1769 <p>Note: many users have asked for a feature whereby the server
1770 automatically "broadcasts" run-time settings to clients, such as
1771 auto-props settings. There's already a feature request filed for this
1773 href="http://subversion.tigris.org/issues/show_bug.cgi?id=1974">issue
1774 1974</a>), though this feature is still being debated by developers,
1775 and isn't being worked on yet.</p>
1777 </div>
1780 <div class="h3" id="svn-editor" title="auto-props">
1781 <h3>How do I deal with spaces in the editor path?&nbsp; Also, how can
1782 I define command line options for the editor?</h3>
1784 <p>The Subversion command line client will invoke the editor defined
1785 in the environment variable SVN_EDITOR.&nbsp; This environment variable
1786 is passed directly to the operating system along with the name of a
1787 temporary file used to enter/edit the log message.</p>
1789 <p>Due to the fact that the SVN_EDITOR string is passed as-is to the
1790 system's command shell, spaces in the editor name, or in the path name
1791 to the editor, will not work unless the editor name is in quotes.</p>
1793 <p>For example, on Windows if your editor is in
1794 <code>C:\Program&nbsp;Files\Posix&nbsp;Tools\bin\vi</code> you would
1795 want to set the variable as follows:
1796 </p>
1797 <pre>
1798 set SVN_EDITOR="C:\Program Files\Posix Tools\bin\vi"
1799 </pre>
1801 <p>Note that there is no need to escape the quotes in the Windows
1802 shell as they are not part of the syntax for the <code>set</code>
1803 command.
1804 </p>
1806 <p>On UNIX systems you would need to follow your shell's specific
1807 methods for setting the variable.&nbsp; For example, in a bash shell,
1808 the following should work:
1809 </p>
1810 <pre>
1811 SVN_EDITOR='"/usr/local/more editors/bin/xemacs"'
1812 export SVN_EDITOR
1813 </pre>
1815 <p>In case a command line option would be needed for the invocation
1816 of the editor, just add that after the editor name in the SVN_EDITOR
1817 environment variable just like you would us on the command line.&nbsp;
1818 For example, if the options <code>-nx -r</code> would be wanted for
1819 the above editors, the following will provide those options:
1820 </p>
1822 <p>For Windows:</p>
1823 <pre>
1824 set SVN_EDITOR="C:\Program Files\Posix Tools\bin\vi" -nx -r
1825 </pre>
1827 <p>For UNIX/bash:</p>
1828 <pre>
1829 SVN_EDITOR='"/usr/local/more editors/bin/xemacs" -nx -r'
1830 export SVN_EDITOR
1831 </pre>
1833 <p>Note that SVN_EDITOR is the Subversion specific environment variable
1834 setting for the editor selection.&nbsp; Subversion also supports
1835 using the more generic EDITOR variable but if you need special behaviors
1836 with Subversion it is best to use the SVN_EDITOR variable.
1837 </p>
1839 </div>
1842 <div class="h3" id="divining-bdb-version" title="divining-bdb-version">
1843 <h3>How do I determine which version of
1844 Berkeley DB a repository is using?</h3>
1846 <p>If it's a live repository, then the easy answer is "Whatever
1847 version of Berkeley DB you have installed". If, however, it is a
1848 repository from a backup, or some unknown source, and you have no idea
1849 which version of Berkeley DB it was made with, here's how you find
1850 out:</p>
1852 <p>Run some command to view the two 4-byte integers at offsets 12 and
1853 16 (decimal) in the highest-numbered db/log.* file in the repository.
1854 Here is an example using GNU od: "<tt>od -j12 -N8 -tx4
1855 log.<i>&lt;number&gt;</i></tt>". Here is an example using Mac OS X
1856 hexdump: "<tt>hexdump -s12 -n8 -x log.<i>&lt;number&gt;</i></tt>".
1857 The first integer should be the magic number 0x00040988, which
1858 identifies the file as a Berkeley DB logfile. The second number is
1859 the log format version
1860 - match it to a Berkeley DB version using the table below:</p>
1862 <table border="1" cellspacing="2" cellpadding="2">
1863 <tr><th>Log format version</th><th>Berkeley DB version</th></tr>
1864 <tr><td>5 (0x00000005)</td><td>4.0</td></tr>
1865 <tr><td>7 (0x00000007)</td><td>4.1</td></tr>
1866 <tr><td>8 (0x00000008)</td><td>4.2</td></tr>
1867 <tr><td>10 (0x0000000a)</td><td>4.3</td></tr>
1868 <tr><td>11 (0x0000000b)</td><td>4.4</td></tr>
1869 <tr><td>12 (0x0000000c)</td><td>4.5</td></tr>
1870 <tr><td>13 (0x0000000d)</td><td>4.6</td></tr>
1871 </table>
1873 </div>
1876 <div class="h3" id="website-auto-update" title="website-auto-update">
1877 <h3>I'm managing a website in my
1878 repository. How can I make the live site automatically update after
1879 every commit?</h3>
1881 <p>This is done all the time, and is easily accomplished by adding a
1882 post-commit hook script to your repository. Read about hook scripts
1883 in <a
1884 href="http://svnbook.red-bean.com/en/1.1/ch05s02.html#svn-ch-5-sect-2.1">Chapter
1885 5</a> of the book. The basic idea is to make the "live site" just an
1886 ordinary working copy, and then have your post-commit hook script run
1887 'svn update' on it.</p>
1889 <p>In practice, there are a couple of things to watch out for. The
1890 server program performing the commit (svnserve or apache) is the same
1891 program that will be running the post-commit hook script. That means
1892 that this program must have proper permissions to update the working
1893 copy. In other words, the working copy must be owned by the same user
1894 that svnserve or apache runs as -- or at least the working copy must
1895 have appropriate permissions set.</p>
1897 <p>If the server needs to update a working copy that it doesn't own
1898 (for example, user joe's ~/public_html/ area), one technique is create
1899 a +s binary program to run the update, since Unix won't allow scripts
1900 to run +s. Compile a tiny C program:</p>
1902 <pre>
1903 #include &lt;stddef.h&gt;
1904 #include &lt;stdlib.h&gt;
1905 #include &lt;unistd.h&gt;
1906 int main(void)
1908 execl("/usr/local/bin/svn", "svn", "update", "/home/joe/public_html/",
1909 (const char *) NULL);
1910 return(EXIT_FAILURE);
1912 </pre>
1914 <p>... and then <tt>chmod +s</tt> the binary, and make sure it's owned
1915 by user 'joe'. Then in the post-commit hook, add a line to run the
1916 binary.</p>
1918 <p>If you have problems getting the hook to work, see <a
1919 href="#hook-debugging">"Why aren't my repository hooks
1920 working?"</a>.</p>
1922 <p>Also, you'll probably want to prevent apache from exporting the
1923 .svn/ directories in the live working copy. Add this to your
1924 <tt>httpd.conf</tt>:</p>
1926 <pre>
1927 # Disallow browsing of Subversion working copy administrative dirs.
1928 &lt;DirectoryMatch "^/.*/\.svn/"&gt;
1929 Order deny,allow
1930 Deny from all
1931 &lt;/DirectoryMatch&gt;
1932 </pre>
1934 </div>
1937 <div class="h3" id="single-file-checkout" title="single-file-checkout">
1938 <h3>How do I check out a single file?</h3>
1940 <p>Subversion does not support checkout of a single file, it only
1941 supports checkout of directory structures.</p>
1943 <p>However, you can use 'svn export' to export a single file. This will
1944 retrieve the file's contents, it just won't create a versioned working
1945 copy.</p>
1947 </div>
1950 <div class="h3" id="wc-change-detection" title="wc-change-detection">
1951 <h3>How do I detect adds, deletes,
1952 copies and renames in a working copy after they've already
1953 happened?</h3>
1955 <p>You don't. It's a bad idea to try.</p>
1957 <p>The basic design of the working copy has two rules: (1) edit files
1958 as you please, and (2) use a Subversion client to make any
1959 tree-changes (add, delete, move, copy). If these rules are followed,
1960 the client can sucessfully manage the working copy. If renames or
1961 other rearrangements happen outside of Subversion, then the UI has
1962 been violated and the working copy might be broken. The client cannot
1963 guess what happened.</p>
1965 <p>People sometimes run into this problem because they want to make
1966 version control "transparent". They trick users into using a working
1967 copy, then have a script run later that tries to guess what happened
1968 and run appropriate client commands. Unfortunately, this technique
1969 only goes a short distance. 'svn status' will show missing items and
1970 unversioned items, which the script can then automatically 'svn rm' or
1971 'svn add'. But if a move or copy has happened, you're out of luck.
1972 Even if the script has a foolproof way of detecting these things, 'svn
1973 mv' and 'svn cp' can't operate after the action has already
1974 occurred.</p>
1976 <p>In summary: a working copy is wholly under Subversion's control,
1977 and Subversion wasn't designed to be transparent. If you're looking
1978 for transparency, try setting up an apache server and using the
1979 "SVNAutoversioning" feature described in appendix C of the book. This
1980 will allow users to mount the repository as a network disk, and any
1981 changes made to the volume cause automatic commits on the server.</p>
1983 </div>
1986 <div class="h3" id="svnserve-win-service" title="svnserve-win-service">
1987 <h3>How do I run svnserve as a service
1988 on Windows?</h3>
1990 <p>For versions 1.4.0 and later, you can find
1991 instructions <a
1992 href="http://svn.collab.net/repos/svn/trunk/notes/windows-service.txt">here</a>.</p>
1994 <p>In versions before 1.4.0, the <tt>svnserve</tt> binary itself could
1995 not be installed as a Windows service, but there are a number of
1996 &ldquo;service wrappers&rdquo; that can do the job; for example:</p>
1998 <ul>
1999 <li><a href="http://www.clanlib.org/~mbn/svnservice/">SVNService</a>
2000 is a free tool written by Magnus Norddahl</li>
2001 <li><a href="http://support.microsoft.com/kb/q137890/">SrvAny</a>
2002 is avaliable free of charge from Microsoft</li>
2003 </ul>
2005 <p>There is a bit more about running <tt>svnserve</tt> as a service in
2007 href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-svnserve.html">the
2008 TortoiseSVN manual</a>.</p>
2010 </div>
2013 <div class="h3" id="bdb-fsfs-convert" title="bdb-fsfs-convert">
2014 <h3>How do I convert my repository from using BDB
2015 to FSFS or from FSFS to BDB?</h3>
2017 <p>There are three steps:</p>
2019 <ol>
2020 <li>A <a href="#dumpload">dump/load</a> from the old format to the new
2021 one.</li>
2022 <li>Copy the hook scripts.</li>
2023 <li>Copy the configuration files.</li>
2024 </ol>
2026 <p>Say you have a repository <tt>/svn/myrepos</tt> which is using the BDB
2027 backend and you would like to switch to using the FSFS backend:</p>
2029 <ol>
2030 <li>Close down your server so that the data cannot change during this
2031 procedure.</li>
2032 <li>Make a new repository specifying the fsfs backend (it is the default
2033 from 1.2 onwards), e.g., <tt>svnadmin create /svn/myreposfsfs --fs-type
2034 fsfs</tt>.</li>
2035 <li>Pipe the output of a dump from <tt>/svn/myrepos</tt> to the input of a
2036 load into <tt>/svn/myreposfsfs</tt>, e.g., <tt>svnadmin dump /svn/myrepos
2037 -q | svnadmin load /svn/myreposfsfs</tt>. Windows users should dump
2038 to a file and load from that file in two separate steps.</li>
2039 <li>Copy any hook scripts which are active in <tt>/svn/myrepos/hooks</tt>
2040 into <tt>/svn/myreposfsfs/hooks</tt>. Don't mindlessly copy everything, the
2041 templates generated by Subversion may have changed.</li>
2042 <li>Compare the template scripts which the <tt>svnadmin create</tt> command
2043 put in <tt>/svn/myreposfsfs/hooks</tt> with those in
2044 <tt>/svn/myrepos/hooks</tt> and incorporate any changes which you would like
2045 into your active hook scripts.</li>
2046 <li>Copy configuration files from <tt>/svn/myrepos/conf</tt>
2047 into <tt>/svn/myreposfsfs/conf</tt> (and don't forget a password
2048 file, if you use one). Or you might instead want to merge
2049 the <em>changes</em> that you made to your configuration files into
2050 the new default ones.</li>
2051 <li>Rename <tt>/svn/myrepos</tt> to <tt>/svn/myreposbdb</tt> and then
2052 <tt>/svn/myreposfsfs</tt> to <tt>/svn/myrepos</tt> ensuring that the
2053 file permissions are the same as those that the BDB version had.</li>
2054 <li>Restart the server.</li>
2055 </ol>
2057 <p>Once you are happy that all is well with your new repository delete the old
2058 one.</p>
2060 <p>To do the reverse and migrate from FSFS to BDB change the <tt>svnadmin
2061 create</tt> command to specify BDB.</p>
2063 </div>
2065 <div class="h3" id="binary-files" title="binary-files">
2066 <h3>How does Subversion handle binary files?</h3>
2068 <p>When you first add or import a file into Subversion, the file is
2069 examined to determine if it is a binary file. Currently, Subversion
2070 just looks at the first 1024 bytes of the file; if any of the bytes
2071 are zero, or if more than 15% are not ASCII printing characters, then
2072 Subversion calls the file binary. This heuristic might be improved in
2073 the future, however.</p>
2075 <p>If Subversion determines that the file is binary, the file receives
2076 an svn:mime-type property set to "application/octet-stream". (You can
2077 always override this by using the <a
2078 href="http://svnbook.red-bean.com/svnbook-1.1/ch07s02.html#svn-ch-7-sect-2.4"
2079 >auto-props feature</a> or by setting the property manually with
2080 <tt>svn propset</tt>.)</p>
2082 <p>Subversion treats the following files as text:</p>
2084 <ul>
2085 <li>Files with no svn:mime-type</li>
2086 <li>Files with a svn:mime-type starting "text/"</li>
2087 <li>Files with a svn:mime-type equal to "image/x-xbitmap"</li>
2088 <li>Files with a svn:mime-type equal to "image/x-xpixmap"</li>
2089 </ul>
2091 <p>All other files are treated as binary, meaning that Subversion will:</p>
2093 <ul>
2094 <li>Not attempt to automatically merge received changes with local
2095 changes during <tt>svn update</tt> or <tt>svn merge</tt></li>
2096 <li>Not show the differences as part of <tt>svn diff</tt></li>
2097 <li>Not show line-by-line attribution for <tt>svn blame</tt></li>
2098 </ul>
2100 <p>In all other respects, Subversion treats binary files the same as
2101 text files, e.g. if you set the svn:keywords or svn:eol-style
2102 properties, Subversion will perform keyword substitution or newline
2103 conversion on binary files.</p>
2105 <p>Note that whether or not a file is binary does not affect the
2106 amount of repository space used to store changes to that file, nor
2107 does it affect the amount of traffic between client and server. For
2108 storage and transmission purposes, Subversion uses a diffing method
2109 that works equally well on binary and text files; this is completely
2110 unrelated to the diffing method used by the 'svn&nbsp;diff'
2111 command.</p>
2113 </div>
2115 <div class="h3" id="terse-diff" title="terse-diff">
2116 <h3>How can I make <tt>svn diff</tt> show me just the names of the
2117 changed files, not their contents?</h3>
2119 <tt>svn diff</tt> doesn't have an option to do this, but
2120 </p>
2121 <ul>
2122 <li>
2123 If you only are interested in the diffs between, say, revision 10
2124 and the revision just before it, <pre>svn log -vq -r10</pre> does
2125 exactly what you want;
2126 </li>
2127 <li>
2128 otherwise, if you're using Unix, this works for any range of revisions:
2129 <pre>
2130 svn log -vq -r123:456 | egrep '^ {3}[ADMR] ' | cut -c6- | sort | uniq </pre> </li>
2131 </ul>
2132 Version 1.4 of the <tt>svn diff</tt> command will have a "--summarize"
2133 option.
2134 </div>
2136 <div class="h3" id="sorry-no-globbing" title="sorry-no-globbing">
2137 <h3>How can I use wildcards or globbing to move many files at once?</h3>
2139 You want to do something like
2140 </p>
2141 <pre>
2142 svn mv svn://server/trunk/stuff/* svn://server/trunk/some-other-dir
2143 </pre>
2145 but it fails with
2146 </p>
2147 <pre>
2148 svn: Path 'svn://server/trunk/stuff/*' does not exist in revision 123
2149 </pre>
2151 ... or some other inscrutable error message.
2152 </p>
2155 The short, unhappy answer is: there's no built-in way to do this; many
2156 commands, like <tt>mv</tt>, refuse to take an arbitrary number of
2157 arguments ... and in any case, Subversion doesn't expand wildcards like
2158 "*" the way the shell does.
2159 </p>
2162 If you happen to have a working copy that contains all the source
2163 files as well as the destination directory, then you can exploit your
2164 shell's wildcard feature to do the move, like this (for Bash):
2165 </p>
2166 <pre>
2167 for i in stuff/*; do svn mv $i some-other-dir; done
2168 svn ci -m "moved all the stuff into some other dir"
2169 </pre>
2172 In any case, you can always accumulate a list of the names of the
2173 source files, and then run "svn mv" on each item in that list, like
2174 this:
2175 </p>
2176 <pre>
2177 s=svn://server/trunk/stuff/
2178 svn ls "$s" | \
2179 while read f
2180 do svn mv "$s/$f" svn://server/trunk/some-other-dir -m "Moved just one file"
2181 done
2182 </pre>
2184 Note, however, that this will generate one commit per source file;
2185 that's in contrast to the above method (using a working copy) which
2186 generates just one commit total.
2187 </p>
2190 There is a program called "svnmucc" or "mucc" depending upon which
2191 version of Subversion you have, whose source is distributed with
2192 Subversion (in ...<tt>/contrib/client-side/mucc/mucc.c</tt> for
2193 Subversion 1.4 or earlier, in
2194 ...<tt>/contrib/client-side/svnmucc/svnmucc.c</tt> for Subversion 1.5
2195 or later), that appears to solve this problem for you.
2196 </p>
2199 Rumor has it that with release 1.5, Subversion will in fact allow you
2200 to "cp" and "mv" multiple files at once.
2201 </p>
2202 </div>
2204 <div class="h3" id="vendor-branch" title="vendor-branch">
2205 <h3>How can I maintain a modified version (a "vendor branch") of
2206 third-party software using Subversion?</h3>
2208 <p>People frequently want to use Subversion to track their local
2209 changes to third-party code, even across upgrades from the
2210 third-party&nbsp;&mdash;&nbsp;that is, they want to maintain their own
2211 divergent branch, while still incorporating new releases from the
2212 upstream source. This is commonly called a <em>vendor branch</em>
2213 (the term long predates Subversion), and the techniques for
2214 maintaining one in Subversion are <a
2215 href="http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.advanced.vendorbr"
2216 >described here</a>.</p>
2218 <p>If the vendor code is hosted in a remote Subversion repository,
2219 then you can use <a href="http://piston.rubyforge.org/">Piston</a> to
2220 manage your copy of the vendor's code.</p>
2222 <p>As a last resort, if using <tt>svn_load_dirs.pl</tt> is taking too
2223 much time or you're looking for the lazy solution, see also Jon
2224 Stevens' step-by-step explanation at <a
2225 href="http://lookfirst.com/2007/11/subversion-vendor-branches-howto.html"
2226 >Subversion Vendor Branches Howto</a>. This solution does not make
2227 use of the space saving features in the Subversion backend when you
2228 copy new code over old code; in this solution, each import of a vendor
2229 code gets an entire new copy and there is no space savings for
2230 identical files.</p>
2232 </div>
2234 </div>
2236 <div class="h2" id="troubleshooting" title="troubleshooting">
2237 <h2>Troubleshooting:</h2>
2238 <p/>
2241 <div id="permissions"></div>
2242 <div class="h3" id="stuck-bdb-repos" title="stuck-bdb-repos">
2243 <h3>My repository seems to get stuck all the
2244 time, giving me errors about needing recovery (DB_RUNRECOVERY). What
2245 could be the cause?</h3>
2247 <p>The Berkeley DB database in your repository is sensitive to
2248 interruptions. If a process accessing the database exits without
2249 "cleanly" closing the environment, then the database is left in an
2250 inconsistent state. Common causes of this include:</p>
2252 <ul>
2253 <li>the process exiting when it hits a permission problem</li>
2254 <li>the process crashing/segfaulting</li>
2255 <li>the process being forcibly killed</li>
2256 <li>running out of disk space</li>
2257 </ul>
2259 <p>For most of these cases, you should run "svnadmin recover", which
2260 rewinds the repository back to a consistent state; see <a
2261 href="#bdb-recovery">this question</a> for details. Note that running
2262 out of disk space, combined with frequent checkouts or updates, can
2263 cause the repository to crash in a way where recovery is not possible
2264 (so keep backups).</p>
2266 <p>Segfaults, forced killings, and running out of disk space are
2267 pretty rare. Permission problems are far more common: one process
2268 accesses the repository and accidentally changes ownership or
2269 permissions, then another process tries to access and chokes on the
2270 permissions.</p>
2272 <p>The best way to prevent this is to get your repository permissions
2273 and ownership set up correctly. See <a href="#reposperms">here</a>
2274 for our recommendations.</p>
2276 </div>
2279 <div id="wedged-repos"></div>
2280 <div class="h3" id="bdb-recovery" title="bdb-recovery">
2281 <h3>Every time I try to access my repository, the
2282 process just hangs. Is my repository corrupt?</h3>
2285 Your repository is not corrupt, nor is your data lost. If your process
2286 accesses the repository directly (mod_dav_svn, svnlook, svnadmin, or
2287 if you access a `file://' URL), then it's using Berkeley DB to access
2288 your data. Berkeley DB is a journaling system, meaning that it logs
2289 everything it is about to do before it does so. If your process is
2290 interrupted (Control-C, or segfault), then a lockfile is left behind,
2291 along with a logfile describing unfinished business. Any other
2292 process that attempts to access the database will just hang, waiting
2293 for the lockfile to disappear. To awaken your repository, you need to
2294 ask Berkeley DB to either finish the work, or rewind the database to a
2295 previous state that is known to be consistent.</p>
2297 <p><b><span style="color: red">WARNING:</span> you can seriously corrupt
2298 your repository if you run recover and another process accesses the
2299 repository.</b></p>
2301 <p>Make absolutely sure you disable all access to the repository before
2302 doing this (by shutting down Apache, removing executable permissions from
2303 'svn'). Make sure you run this command as the user that owns and manages
2304 the database, and not as root, else it will leave root-owned files in the
2305 db directory which cannot be opened by the non-root user that manages the
2306 database, which is typically either you or your Apache process. Also be
2307 sure to have the correct umask set when you run recover, since failing to
2308 do so will lock out users that are in the group allowed to access the
2309 repository.</p>
2312 Simply run:</p>
2314 <pre>
2315 svnadmin recover /path/to/repos
2316 </pre>
2318 <p>Once the command has completed, check the permissions in the
2319 <code>db</code> directory of the repository.</p>
2321 <p>Sometimes "svnadmin&nbsp;recover" doesn't work. You may see it
2322 give errors like this:</p>
2324 <pre>
2325 Repository lock acquired.
2326 Please wait; recovering the repository may take some time...
2327 svnadmin: DB_RUNRECOVERY: Fatal error, run database recovery
2328 svnadmin: bdb: Recovery function for LSN 175 7066018 failed on backward pass
2329 svnadmin: bdb: PANIC: No such file or directory
2330 svnadmin: bdb: PANIC: fatal region error detected; run recovery
2331 </pre>
2333 <p>or like this:</p>
2335 <pre>
2336 Repository lock acquired.
2337 Please wait; recovering the repository may take some time...
2338 svn: DB_RUNRECOVERY: Fatal error, run database recovery
2339 svn: bdb: DB_ENV-&gt;log_flush: LSN of 115/802071 past current end-of-log
2340 of 115/731460
2341 svn: bdb: Database environment corrupt; the wrong log files may have
2342 been removed or incompatible database files imported from another
2343 environment
2344 [...]
2345 svn: bdb: changes: unable to flush page: 0
2346 svn: bdb: txn_checkpoint: failed to flush the buffer cache Invalid argument
2347 svn: bdb: PANIC: Invalid argument
2348 svn: bdb: PANIC: fatal region error detected; run recovery
2349 svn: bdb: PANIC: fatal region error detected; run recovery
2350 [...]
2351 </pre>
2353 <p>In that case, try Berkeley DB's native <b>db_recover</b> utility
2354 (see <a href="http://www.oracle.com/technology/documentation/berkeley-db/db/utility/db_recover.html"
2355 >db_recover documentation</a>). It
2356 usually lives in a "bin/" subdirectory of the Berkeley DB installation,
2357 for example if you installed Berkeley DB from source, it might be
2358 <tt>/usr/local/BerkeleyDB.4.2/bin/db_recover</tt>; or on systems where
2359 Berkeley DB comes prepackaged it might just be
2360 <tt>/usr/bin/db_recover</tt>. If you have multiple versions of
2361 Berkeley DB installed, make sure that the version of db_recover you
2362 use matches the version of Berkeley DB with which your repository was
2363 created.</p>
2365 <p>Run db_recover with the "-c" ("catastrophic recovery") flag. You
2366 can also add "-v" for verbosity, and "-h" with an argument telling it
2367 what db environment to recover (so you don't have to cd into that
2368 directory). Thus:</p>
2370 <pre>
2371 db_recover -c -v -h /path/to/repos/db
2372 </pre>
2374 <p>Run this command as the same user that owns the repository, and
2375 again, make absolutely sure that no other processes are accessing the
2376 repository while you do this (e.g., shut down svnserve or Apache).</p>
2378 </div>
2381 <div class="h3" id="bdb-cannot-allocate-memory" title="bdb-cannot-allocate-memory">
2382 <h3>My repository keeps giving errors saying "Cannot allocate memory".
2383 What should I do?</h3>
2385 <p>If you're using http:// access, "<b>Cannot allocate memory</b>"
2386 errors show up in the httpd error log and look something like
2387 this:</p>
2389 <blockquote>
2390 <pre>
2391 [Wed Apr 07 04:26:10 2004] [error] [client 212.151.130.227] (20014)
2392 Error string not specified yet: Berkeley DB error while opening
2393 'strings' table for filesystem /usr/local/svn/repositories/svn/db:
2394 Cannot allocate memory
2395 [Wed Apr 07 04:26:10 2004] [error] [client 212.151.130.227]
2396 Could not fetch resource information. [500, #0]
2397 [Wed Apr 07 04:26:10 2004] [error] [client 212.151.130.227]
2398 Could not open the requested SVN filesystem [500, #160029]
2399 [Wed Apr 07 04:26:10 2004] [error] [client 212.151.130.227] (17)
2400 File exists: Could not open the requested SVN filesystem [500, #160029]
2401 </pre>
2402 </blockquote>
2404 <p>It usually means that a Berkeley DB repository has run out of
2405 database locks (this does not happen with FSFS repositories). It
2406 shouldn't happen in the course of normal operations, but if it does,
2407 the solution is to run database recovery as described <a
2408 href="#bdb-recovery">here</a>. If it happens often, you probably need
2409 to raise the default lock parameters (<tt>set_lk_max_locks</tt>,
2410 <tt>set_lk_max_lockers</tt>, and <tt>set_lk_max_objects</tt>) in the
2411 db/DB_CONFIG file. When changing DB_CONFIG in an existing repository,
2412 remember to run recovery afterwards.</p>
2414 </div>
2417 <div class="h3" id="wedged-wc" title="wedged-wc">
2418 <h3>Every time I try to run a svn command, it says my
2419 working copy is locked. Is my working copy corrupt?</h3>
2422 Your working copy is not corrupt, nor is your data lost. Subversion's
2423 working copy is a journaling system, meaning that it logs everything it
2424 is about to do before it does so. If the svn client program is
2425 interrupted violently (segfault or killed, not with Control-C), then
2426 one or more lockfiles are left behind, along with logfiles describing
2427 unfinished business. (The `svn status' command will show an 'L' next
2428 to locked directories.) Any other process that attempts to access the
2429 working copy will fail when it sees the locks. To awaken your working
2430 copy, you need to tell the svn client to finish the work. Simply
2431 run:</p>
2433 <pre>
2434 svn cleanup working-copy
2435 </pre>
2437 </div>
2440 <div class="h3" id="wc-out-of-date" title="wc-out-of-date">
2441 <h3>I'm trying to commit, but Subversion says my
2442 working copy is out of date?</h3>
2444 <p>Three kinds of situation that can cause this:</p>
2446 <ol>
2448 <li><p>Debris from a failed commit is littering your working copy.</p>
2450 <p>You may have had a commit that went sour between the time the
2451 new revision was added in the server and the time your client
2452 performed its post-commit admin tasks (including refreshing your
2453 local text-base copy). This might happen for various reasons
2454 including (rarely) problems in the database back end or (more
2455 commonly) network dropouts at exactly the wrong time.</p>
2457 <p>If this happens, it's possible that you have already committed
2458 the very changes you are trying now to commit. You can use 'svn
2459 log -rHEAD' to see if your supposed-failed commit actually
2460 succeeded. If it did, run 'svn revert' to revert your local
2461 changes, then run 'svn update' to get your own changes back from the
2462 server. (Note that only 'svn update' brings your local copies
2463 up-to-date; revert doesn't do that.)</p>
2464 </li>
2466 <li><p>Mixed revisions.</p>
2468 <p>When Subversion commits, the client only bumps the revision
2469 numbers of the nodes the commit touches, not all nodes in the
2470 working copy. This means that in a single working copy, the
2471 files and subdirectories might be at different revisions,
2472 depending on when you last committed them. In certain operations
2473 (for example, directory property modifications), if the
2474 repository has a more recent version of the node, the commit will
2475 be rejected, to prevent data loss. See <a
2476 href="http://svnbook.red-bean.com/svnbook/ch02s03.html#svn-ch-2-sect-3.4">
2477 The Limitations of Mixed Revisions</a> in the <a
2478 href="http://svnbook.red-bean.com/">Version Control with
2479 Subversion</a> for details.</p>
2481 <p>You can fix the problem by running 'svn update' in the working
2482 copy.</p>
2483 </li>
2485 <li><p>You might be genuinely out of date&nbsp;&mdash;&nbsp;that is,
2486 you're trying to commit a change to a file that has been changed
2487 by someone else since you last updated your copy of that file.
2488 Again, 'svn update' is the way to fix this.</p>
2489 </li>
2490 </ol>
2491 </div>
2494 <div class="h3" id="obstructed-add" title="obstructed-add">
2495 <h3>I've contributed a patch to a project and the patch added a new file.
2496 Now <tt>svn update</tt> does not work.</h3>
2498 <p>In order to include your new file in the patch you likely ran the <tt>svn add</tt>
2499 command so that the <tt>svn diff</tt> command would include the new file in the patch.
2500 If your patch is committed to the code base and you run an <tt>svn update</tt>, then
2501 you might receive an error message of: "svn: Failed to add file 'my.new.file':
2502 object of the same name already exists".</p>
2504 <p>The reason that you recieved this error is that you still have your local copy of
2505 the file in your working copy. The steps to correct this problem are:</p>
2507 <ol>
2508 <li>Run the <tt>svn revert</tt> command to remove the scheduled add within
2509 Subversion.</li>
2510 <li>Delete the file or move it to a location outside your working copy.</li>
2511 <li>Now you should be able to run the <tt>svn update</tt> command.</li>
2512 </ol>
2514 <p>You might want to compare the new file from the repository with your original file.</p>
2515 </div>
2518 <div class="h3" id="unrecognized-url-error" title="unrecognized-url-error">
2519 <h3>I just built the distribution binary,
2520 and when I try to check out Subversion, I get an error about an
2521 "Unrecognized URL scheme." What's up with that?</h3>
2523 <p>Subversion uses a plugin system to allow access to repositories.
2524 Currently there are three of these plugins: ra_local allows access to
2525 a local repository, ra_dav which allows access to a repository via
2526 WebDAV, and ra_svn allows local or remote access via the svnserve
2527 server. When you attempt to perform an operation in Subversion, the
2528 program tries to dynamically load a plugin based on the URL scheme. A
2529 `file://' URL will try to load ra_local, and an `http://' URL will try
2530 to load ra_dav.</p>
2532 <p>The error you are seeing means that the dynamic linker/loader can't find
2533 the plugins to load. This normally happens when you build Subversion with
2534 shared libraries, then attempt to run it without first running 'make
2535 install'. Another possible cause is that you ran make install, but the
2536 libraries were installed in a location that the dynamic linker/loader
2537 doesn't recognize. Under Linux, you can allow the linker/loader to find the
2538 libraries by adding the library directory to /etc/ld.so.conf and running
2539 ldconfig. If you don't wish to do this, or you don't have root access, you
2540 can also specify the library directory in the LD_LIBRARY_PATH environment
2541 variable.</p>
2543 </div>
2546 <div class="h3" id="db-recover" title="db-recover">
2547 <h3>I'm getting errors finding or opening a repository,
2548 but I know my repository URL is correct. What's wrong?</h3>
2550 <p>See <a href="#bdb-recovery">this faq.</a></p>
2552 </div>
2556 <div class="h3" id="configure-sed-error" title="configure-sed-error">
2557 <h3>When I run `<tt>configure</tt>', I get errors about
2558 <tt>subs-1.sed&nbsp;line&nbsp;38:&nbsp;Unterminated&nbsp;`s'&nbsp;command</tt>.
2559 What's wrong?</h3>
2562 You probably have old copies of
2563 <tt>/usr/local/bin/apr-config</tt> and
2564 <tt>/usr/local/bin/apu-config</tt> on your system. Remove them, make
2565 sure the <tt>apr/</tt> and <tt>apr-util/</tt> that you're
2566 building with are completely up-to-date, and try again.
2567 </p>
2569 </div>
2572 <div class="h3" id="windows-msvc-build" title="windows-msvc-build">
2573 <h3>I'm having trouble building Subversion
2574 under Windows with MSVC++ 6.0. What should I do?</h3>
2577 Probably you just need to get the latest platform SDK. The one that
2578 ships with VC++ 6.0 is not recent enough.
2579 </p>
2581 </div>
2584 <div class="h3" id="windows-drive-letter" title="windows-drive-letter">
2585 <h3>How can I specify a Windows drive letter in
2586 a <tt>file:</tt> URL?</h3>
2588 <p>Like this:</p>
2589 <pre>
2590 svn import file:///d:/some/path/to/repos/on/d/drive
2591 </pre>
2592 <p>See <a
2593 href="http://svnbook.red-bean.com/html-chunk/ch02s03.html#svn-ch-2-sidebar-1">
2594 Repository URLs</a> in the Subversion Book for more details.</p>
2596 </div>
2599 <div class="h3" id="vs-asp-net" title="vs-asp-net">
2600 <h3>VS.NET/ASP.NET seems to have a problem with
2601 the ".svn" directory name. What should I do?</h3>
2603 <p>VS.Net has a subsystem called ASP.Net, which uses WebDAV to do
2604 remote publishing through IIS. This subsystem rejects any pathname
2605 that starts with ".". This causes a problem when you try to remotely
2606 publish a Subversion working copy, because of the ".svn"
2607 subdirectories. The error message says something like "unable to
2608 read project information".</p>
2610 <p>To work around this, set the environment variable
2611 SVN_ASP_DOT_NET_HACK to any value&nbsp;&mdash;&nbsp;this will tell
2612 Windows clients to use "_svn" as a directory name in your working
2613 copy. See <a
2614 href="http://subversion.tigris.org/svn_1.3_releasenotes.html#_svn-hack"
2615 >the relevant section of the Subversion 1.3 release notes</a> for more
2616 details, and see <a href="#adm-dir">this question</a> for other ways to
2617 customize the administrative directory name.</p>
2619 </div>
2622 <div class="h3" id="write-over-dav" title="write-over-dav">
2623 <h3>I'm having trouble doing write
2624 operations to a Subversion repository over a network.</h3>
2626 <p>For example, one user reported that imports worked fine over local
2627 access:</p>
2628 <pre>
2629 $ mkdir test
2630 $ touch test/testfile
2631 $ svn import test file:///var/svn/test -m "Initial import"
2632 Adding test/testfile
2633 Transmitting file data .
2634 Committed revision 1.
2635 </pre>
2636 But not from a remote host:
2637 <pre>
2638 $ svn import http://svn.sabi.net/test testfile -m "import"
2639 nicholas's password: xxxxxxx
2641 svn_error: #21110 : &lt;Activity not found&gt;
2643 The specified activity does not exist.
2644 </pre>
2646 <p> We've seen this when the REPOS/dav/ directory is not writable by
2647 the httpd process. Check the permissions to ensure Apache can write
2648 to the <tt>dav/</tt> directory (and to <tt>db/</tt>, of course). </p>
2650 </div>
2654 <div class="h3" id="windows-xp-server" title="windows-xp-server">
2655 <h3>Under Windows XP, the Subversion server
2656 sometimes seems to send out corrupted data. Can this really
2657 be happening?</h3>
2659 <p>You need to install Window XP Service Pack 1. You can get all
2660 sorts of information about that Service Pack here:</p>
2662 <ul><li>
2663 <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q317949"
2664 >http://support.microsoft.com/default.aspx?scid=kb;EN-US;q317949</a>
2665 </li></ul>
2667 </div>
2670 <a name="ethereal"></a> <!-- for compatibility with old question -->
2671 <div class="h3" id="net-trace" title="net-trace">
2672 <h3>What is the best method of doing a network
2673 trace of the conversation between a Subversion client and
2674 server?</h3>
2676 <p>Use <a href="http://www.wireshark.org/">Wireshark</a> (formerly
2677 known as "Ethereal") to eavesdrop on the conversation.</p>
2679 <p>First, make sure that between captures within the same wireshark
2680 session, you hit <em>Clear</em>, otherwise filters from one capture
2681 (say, an HTTP capture) might interfere with others (say, an ra_svn
2682 capture). </p>
2684 <p>Assuming you're cleared, then:</p>
2686 <ol>
2687 <li><p>Pull down the <i>Capture</i> menu, and choose
2688 <i>Capture&nbsp;Filters</i>.</p></li>
2689 <li><p>If debugging the http:// (WebDAV) protocol, then in the window
2690 that pops up, choose "<code>HTTP&nbsp;TCP&nbsp;port&nbsp;(80)</code>"
2691 (which should result in the filter string
2692 "<code><i>tcp&nbsp;port&nbsp;http</i></code>").</p>
2693 <p>If debugging the svn:// (ra_svn) protocol, then choose <i>New</i>,
2694 give the new filter a name (say, "ra_svn"), and type
2695 "<code>tcp&nbsp;port&nbsp;3690</code>" into the filter string box.</p>
2696 <p>When done, click OK.</p></li>
2697 <li><p>Again go to the <i>Capture</i> menu, this time choose
2698 <i>Interfaces</i>, and click <i>Options</i> next to the
2699 appropriate interface (probably you want interface "lo", for
2700 "loopback", assuming the server will run on the same machine as
2701 the client).</p></li>
2702 <li><p>Turn off promiscuous mode by unchecking the appropriate
2703 checkbox.</p></li>
2704 <li><p>Click the <i>Start</i> button in the lower right to start the
2705 capture.</p></li>
2706 <li><p>Run your Subversion client.</p></li>
2707 <li><p>Click the Stop icon (a red X over an ethernet interface card) when
2708 the operation is finished (or <i>Capture-&gt;Stop</i> should
2709 work). Now you have a capture. It looks like a huge list of
2710 lines.</p></li>
2711 <li><p>Click on the <i>Protocol</i> column to sort.</p></li>
2712 <li><p>Then, click on the first relevant line to select it; usually this
2713 is just the first line.</p></li>
2714 <li><p>Right click, and choose <i>Follow TCP Stream</i>. You'll be
2715 presented with the request/response pairs of the Subversion
2716 client's HTTP conversion.</p></li>
2717 </ol>
2719 <p>The above instructions are specific to the graphical version of
2720 Wireshark (version 0.99.6), and don't apply to the command-line
2721 version known as "tshark" (which corresponds to "tethereal", from back
2722 when Wireshark was called Ethereal).</p>
2724 <p>Alternatively, you may set the <tt>neon-debug-mask</tt> parameter in your
2725 <tt>servers</tt> configuration file to cause neon's debugging output
2726 to appear when you run the <tt>svn</tt> client. The numeric value of
2727 <tt>neon-debug-mask</tt> is a combination of the <tt>NE_DBG_...</tt> values
2728 in the header file <tt>ne_utils.h</tt>. For current versions of neon, setting
2729 <tt>neon-debug-mask</tt> to 130 (i.e. <tt>NE_DBG_HTTP+NE_DBG_HTTPBODY)</tt>
2730 will cause the HTTP data to be shown.</p>
2732 <p>You may well want to disable compression when doing a network
2733 trace&mdash;see the <tt>http-compression</tt> parameter in the <tt>servers</tt>
2734 configuration file.</p>
2736 <p>Another alternative is to set up a logging proxy between the
2737 Subversion client and server. A simple way to do this is to use
2738 the <tt>socat</tt> program. For example, to log communication with
2739 an svnserve instance, run the following command:</p>
2741 <p><tt>socat -v TCP4-LISTEN:9630,reuseaddr,fork
2742 TCP4:localhost:svn</tt></p>
2744 <p>Then run your svn commands using an URL base
2745 of <tt>svn://127.0.0.1:9630/</tt>; <tt>socat</tt> will forward the
2746 traffic from port 9630 to the normal svnserve port (3690), and will
2747 print all traffic in both directions to standard error, prefixing it
2748 with &lt; and &gt; signs to show the direction of the traffic.</p>
2750 </div>
2753 <div class="h3" id="revert" title="revert">
2754 <h3>Why does the <tt>svn revert</tt> require an
2755 explicit target? Why is it not recursive by default? These
2756 behaviors differ from almost all the other subcommands.</h3>
2758 <p>The short answer: it's for your own good.</p>
2760 <p>Subversion places a very high priority on protecting your data, and
2761 not just your versioned data. Modifications that you make to
2762 already-versioned files, and new files scheduled for addition to the
2763 version control system, must be treated with care.</p>
2765 <p>Making the <tt>svn revert</tt> command require an explicit
2766 target&mdash;even if that target is just '.'&mdash;is one way of
2767 accomplishing that. This requirement (as well as requiring you to
2768 supply the <tt>--recursive (-R)</tt> flag if you want that behavior)
2769 is intended to make you really think about what you're doing, because
2770 once your files are reverted, your local modifications are gone
2771 forever.</p>
2773 </div>
2777 <div class="h3" id="db3db4" title="db3db4">
2778 <h3>When I start Apache, mod_dav_svn complains about
2779 a "bad database version", that it found db-3.X, rather than
2780 db-4.X.</h3>
2782 <p>Your apr-util linked against DB-3, and svn linked against DB-4.
2783 Unfortunately, the DB symbols aren't different. When mod_dav_svn is
2784 loaded into Apache's process-space, it ends up resolving the
2785 symbol names against apr-util's DB-3 library.</p>
2787 <p>The solution is to make sure apr-util compiles against DB-4. You
2788 can do this by passing specific switches to either apr-util's or
2789 apache's configure: "--with-dbm=db4 --with-berkeley-db=/the/db/prefix".</p>
2791 </div>
2795 <div class="h3" id="redhat-db" title="redhat-db">
2796 <h3>I'm getting "Function not implemented" errors on Red Hat
2797 9, and nothing works. How do I fix this?</h3>
2799 <p>This is not really a problem with Subversion, but it often affects
2800 Subversion users.</p>
2802 <p>Red Hat 9 and Fedora ship with a Berkeley DB library that relies on
2803 the kernel support for NPTL (the Native Posix Threads Library).</p>
2805 <p>The kernels that Red Hat provides have this support built in, but if you
2806 compile your own kernel, then you may well not have the NPTL support. If that
2807 is the case, then you will see errors like this:</p>
2808 <blockquote><pre>
2809 svn: Berkeley DB error
2810 svn: Berkeley DB error while creating environment for filesystem tester/db:
2811 Function not implemented
2812 </pre></blockquote>
2813 <p>This can be fixed in one of several ways:</p>
2814 <ul>
2815 <li>Rebuild Berkeley DB for the kernel you're using.</li>
2816 <li>Use a Red Hat 9 kernel.</li>
2817 <li>Apply the NPTL patches to the kernel you're using.</li>
2818 <li>Use a recent (2.5.x) kernel with the NPTL support included.</li>
2819 <li>Check if environment variable <code>LD_ASSUME_KERNEL</code> is set
2820 to <code>2.2.5</code>, and if so, unset it before starting
2821 Subversion (Apache). (You usually would set this variable to run
2822 Wine or Winex on Red Hat 9)</li>
2823 </ul>
2824 <p>To use the NPTL version of Berkeley DB you also need to use a glibc
2825 library with NPTL support, which probably means the i686 version. See
2827 href="http://svn.haxx.se/users/archive-2004-03/0488.shtml">
2828 http://svn.haxx.se/users/archive-2004-03/0488.shtml
2829 </a> for details.
2830 </p>
2832 </div>
2835 <div class="h3" id="no-author" title="no-author">
2836 <h3>Why does SVN log say "(no author)" for files
2837 committed or imported via Apache (ra_dav)?</h3>
2839 <p>If you allow anonymous write access to the repository via Apache,
2840 the Apache server never challenges the SVN client for a username, and
2841 instead permits the write operation without authentication. Since
2842 Subversion has no idea who did the operation, this results in a log
2843 like this:</p>
2845 <blockquote><pre>
2846 $ svn log
2847 ------------------------------------------------------------------------
2848 rev 24:&nbsp; (no author) | 2003-07-29 19:28:35 +0200 (Tue, 29 Jul 2003)
2849 </pre></blockquote>
2851 <p>See the Subversion Book (<a
2852 href="http://svnbook.red-bean.com/book.html#svn-ch-5-sect-4"
2853 >"Networking a Repository"</a>)
2854 to learn about configuring access restrictions in Apache.</p>
2856 </div>
2860 <div class="h3" id="windows-access-denied" title="windows-access-denied">
2861 <h3>I'm getting occasional "Access Denied"
2862 errors on Windows. They seem to happen at random. Why?</h3>
2864 <p>These appear to be due to the various Windows services that monitor
2865 the filesystem for changes (anti-virus software, indexing services, the
2866 COM+ Event Notification Service). This is not really a bug in Subversion,
2867 which makes it difficult for us to fix. A summary of the current state of
2868 the investigation is available <a href=
2869 "http://svn.haxx.se/dev/archive-2003-10/0136.shtml">here</a>.
2870 A workaround that should reduce the incidence rate for most people was
2871 implemented in revision 7598; if you have an earlier version, please
2872 update to the latest release.
2873 </p>
2875 </div>
2878 <div class="h3" id="freebsd-hang" title="freebsd-hang">
2879 <h3>On FreeBSD, certain operations (especially
2880 svnadmin create) sometimes hang. Why?</h3>
2882 <p>This is usually due to a lack of available entropy on the system.
2883 You probably need to configure the system to gather entropy from
2884 sources such as hard-disk and network interrupts. Consult your system
2885 manpages, specifically random(4) and rndcontrol(8) on how to effect
2886 this change.</p>
2888 </div>
2891 <a name="301-error"></a> <!-- for compatibility with old
2892 non-XML-name-compliant fragment id -->
2893 <div class="h3" id="http-301-error" title="http-301-error">
2894 <h3>I can see my repository in a web browser, but
2895 'svn checkout' gives me an error about "301 Moved Permanently".
2896 What's wrong?</h3>
2898 <p>It means your httpd.conf is misconfigured. Usually this error happens
2899 when you've defined the Subversion virtual "location" to exist within
2900 two different scopes at the same time.</p>
2902 <p>For example, if you've exported a repository as <tt>&lt;Location
2903 /www/foo&gt;</tt>, but you've also set your <tt>DocumentRoot</tt> to
2904 be <tt>/www</tt>, then you're in trouble. When the request comes in
2905 for <tt>/www/foo/bar</tt>, apache doesn't know whether to find a
2906 <i>real</i> file named <tt>/foo/bar</tt> within your
2907 <tt>DocumentRoot</tt>, or whether to ask mod_dav_svn to fetch a file
2908 <tt>/bar</tt> from the <tt>/www/foo</tt> repository. Usually the
2909 former case wins, and hence the "Moved Permanently" error.</p>
2911 <p>The solution is to make sure your repository
2912 <tt>&lt;Location&gt;</tt> does <b>not</b> overlap or live within any
2913 areas already exported as normal web shares.</p>
2915 <p>It's also possible that you have an object in the web root
2916 which has the same name as your repository URL. For example,
2917 imagine your web server's document root is <tt>/var/www</tt>
2918 and your Subversion repository is located at
2919 <tt>/home/svn/repo</tt>. You then configure Apache to serve
2920 the repository at <tt>http://localhost/myrepo</tt>. If you then
2921 create the directory <tt>/var/www/myrepo/</tt> this will cause
2922 a 301 error to occur.</p>
2925 </div>
2928 <div class="h3" id="no-copy-history" title="no-copy-history">
2929 <h3>I'm trying to look at an old version of my
2930 file, but svn says something about "path not found". What's going
2931 on?</h3>
2933 <p>A nice feature of Subversion is that the repository understands
2934 copies and renames, and preserves the historical connections. For
2935 example, if you copy <tt>/trunk</tt> to <tt>/branches/mybranch</tt>,
2936 then the repository understands that every file in the branch has a
2937 "predecessor" in the trunk. Running <tt>svn log --verbose</tt> will
2938 show you the historical copy, so you can see the rename:</p>
2940 <pre>
2941 r7932 | joe | 2003-12-03 17:54:02 -0600 (Wed, 03 Dec 2003) | 1 line
2942 Changed paths:
2943 A /branches/mybranch (from /trunk:7931)
2944 </pre>
2946 <p>Unfortunately, while the repository is aware of copies and renames,
2947 almost all the svn client subcommands are <b>not</b> aware. Commands
2948 like <tt>svn diff</tt>, <tt>svn merge</tt>, and <tt>svn cat</tt> ought
2949 to understand and follow renames, but don't yet do this. It's
2950 scheduled as post-1.0 feature, currently <a
2951 href="http://subversion.tigris.org/issues/show_bug.cgi?id=1093">issue
2952 #1093</a>. For example, if you ask <tt>svn diff</tt> to compare two
2953 earlier versions of <tt>/branches/mybranch/foo.c</tt>, the command
2954 will not automatically understand that the task actually requires
2955 comparing two versions of <tt>/trunk/foo.c</tt>, due to the rename.
2956 Instead, you'll see an error about how the branch-path doesn't exist
2957 in the earlier revisions.</p>
2959 <p>The workaround for all problems of this sort is to do the legwork
2960 yourself. That is: <i>you</i> need to be aware of any renamed paths,
2961 discover them yourself using <tt>svn log -v</tt>, and then provide
2962 them explicitly to the svn client. For example, instead of
2963 running</p>
2965 <pre>
2966 $ svn diff -r 1000:2000 http://host/repos/branches/mybranch/foo.c
2967 svn: Filesystem has no item
2968 svn: '/branches/mybranch/fooc..c' not found in the repository at revision 1000
2969 </pre>
2971 ...you would instead run
2973 <pre>
2974 $ svn diff -r1000:2000 http://host/repos/trunk/foo.c
2976 </pre>
2978 </div>
2981 <div class="h3" id="digest-auth" title="digest-auth">
2982 <h3>Why doesn't HTTP Digest auth work?</h3>
2984 <p>This is probably due to a known bug in Apache HTTP Server (versions
2985 2.0.48 and earlier), for which a patch is available, see
2986 <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25040"
2987 >http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25040</a>. You
2988 may also want to read over
2989 <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=1608"
2990 >http://subversion.tigris.org/issues/show_bug.cgi?id=1608</a>
2991 to see if the description there matches your symptoms.
2992 </p>
2994 </div>
2997 <div class="h3" id="xlc-compile" title="xlc-compile">
2998 <h3>Compiling with xlc on AIX, I get compilation
2999 errors. What's wrong?</h3>
3001 <p>Adding <tt>-qlanglvl=extended</tt> to the
3002 environment variable CFLAGS for configuration and build
3003 will make xlc a bit more flexible and the code should
3004 compile without error. See
3005 <a href="http://svn.haxx.se/dev/archive-2004-01/0922.shtml"
3006 >http://svn.haxx.se/dev/archive-2004-01/0922.shtml</a> and
3007 its associated thread for more details.
3008 </p>
3010 </div>
3013 <div class="h3" id="nonrecursive-checkout" title="nonrecursive-checkout">
3014 <h3>I checked out a directory non-recursively
3015 (with -N), and now I want to make certain subdirectories
3016 "appear". But <tt>svn up subdir</tt> doesn't work.</h3>
3018 <p>See <a
3019 href="http://subversion.tigris.org/issues/show_bug.cgi?id=695">issue
3020 695</a>. The current implementation of <tt>svn checkout -N</tt> is
3021 quite broken. It results in a working copy which has missing entries,
3022 yet is ignorant of its "incompleteness". Apparently a whole bunch of
3023 CVS users are fairly dependent on this paradigm, but none of the
3024 Subversion developers were. For now, there's really no workaround
3025 other than to change your process: try checking out separate
3026 subdirectories of the repository and manually nesting your working
3027 copies.</p>
3029 </div>
3032 <div class="h3" id="mod_dav_svn-win32" title="mod_dav_svn-win32">
3033 <h3>I am trying to use mod_dav_svn
3034 with Apache on Win32 and I'm getting an error saying that the
3035 module cannot be found, yet the mod_dav_svn.so file is right
3036 there in <tt>\Apache\modules.</tt></h3>
3038 <p>The error message in this case is a little misleading. Most likely
3039 Apache is unable to load one or more DLLs that <tt>mod_dav_svn.so</tt>
3040 relies on. If Apache is running as a service it will not have the
3041 same <tt>PATH</tt> as a regular user. Make sure that
3042 <tt>libdb4*.dll</tt>, <tt>libeay32.dll</tt> and <tt>ssleay32.dll</tt>
3043 are present in either <tt>\Apache\bin</tt> or
3044 <tt>\Apache\modules</tt>. You can copy them from your Subversion
3045 installation directory if they are not there.</p>
3047 <p>If this still does not resolve the problem, you should use a tool
3048 like <a href="http://www.dependencywalker.com">Dependency Walker</a>
3049 on <tt>mod_dav_svn.so</tt> to see if there are any other unresolved
3050 dependencies.</p>
3052 </div>
3055 <a name="win32-hooks"></a> <!-- for compatibility with old question -->
3056 <a name="hook-environment"></a> <!-- for yet more compatibility with old question -->
3057 <div class="h3" id="hook-debugging" title="hook-debugging">
3058 <h3>Why aren't my repository hooks working?</h3>
3060 <p>They're supposed to invoke external programs, but the invocations
3061 never seem to happen.</p>
3063 <p>Before Subversion calls a hook script, it removes <em>all</em>
3064 variables -- including $PATH on Unix, and %PATH% on Windows
3065 -- from the environment. Therefore, your script can only
3066 run another program if you
3067 spell out that program's absolute name.</p>
3069 <p><b>Debugging tips:</b></p>
3071 If you're using Linux or Unix, try running the script "by hand", by
3072 following these steps:</p>
3074 <ol>
3075 <li>Use "su", "sudo", or something similar, to become the user who
3076 normally would run the script. This might be <tt>httpd</tt> or
3077 <tt>www-data</tt>, for example, if you're using Apache;
3078 it might be a user like <tt>svn</tt> if you're running
3079 svnserve and a special Subversion user exists. This
3080 will make clear any permissions problems that the script
3081 might have.
3082 </li>
3083 <li>
3084 Invoke the script with an empty environment by using the
3085 "env" program. Here's an
3086 example for the post-commit hook:
3087 <blockquote><pre>
3088 $ env - ./post-commit /var/lib/svn-repos 1234
3089 </pre></blockquote>
3090 Note the first argument to "env" is a dash; that's what
3091 ensures the environment is empty.
3092 </li>
3093 <li>
3094 Check your console for errors.
3095 </li>
3096 </ol>
3098 </div>
3101 <div class="h3" id="diff-cmd" title="diff-cmd">
3102 <h3>Why does my --diff-cmd complain about '-u'?
3103 I tried to override it with --extensions, but it's not working.</h3>
3105 <p>When using an external diff command, Subversion builds a fairly
3106 complicated command line. First is the specified --diff-cmd. Next comes
3107 the specified --extensions (although empty --extensions are ignored), or
3108 '-u' if --extensions is unspecified (or specified as ''). Third and
3109 fourth, Subversion passes a '-L' and the first file's label (e.g.
3110 "project_issues.html (revision 11209)"). Fifth and sixth are another
3111 '-L' and the second label. Seventh and eighth are the first and second
3112 file names (e.g. ".svn/text-base/project_issues.html.svn-base" and
3113 ".svn/tmp/project_issues.html.tmp").</p>
3115 <p>If your preferred diff command does not support these arguments, you
3116 may need to create a small wrapper script to discard arguments and just
3117 use the last couple file paths.</p>
3119 <p>Warning: Beware that Subversion does not expect the external diff
3120 program to change the files it receives, and doing so may scramble the
3121 working copy.</p>
3123 <p>For further information, see issue
3124 <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=2044">#2044</a>.</p>
3126 </div>
3129 <div class="h3" id="plaintext-passwords" title="plaintext-passwords">
3130 <h3>Ahhh! I just discovered that my
3131 Subversion client is caching passwords in plain-text on disk!
3132 AHHH!</h3>
3134 <p>Calm down, take a deep breath.</p>
3136 <p>On Windows 2000 or later, svn 1.2 and above uses standard
3137 Windows APIs to encrypt the data, so only the user can decrypt the
3138 cached password.</p>
3140 <p>On Mac OS X, svn 1.4 and later uses the system Keychain
3141 facility to encrypt/store your svn password.</p>
3143 <p>On UNIX/Linux, there are no standard system encryption facilities,
3144 so the password is stored in ~/.subversion/auth/. Notice, however,
3145 that the directory which contains the cached passwords (usually
3146 ~/.subversion/auth/) has permissions of 700, meaning only you can read
3147 them.</p>
3149 <p>Trust your OS to protect data on disk.</p>
3151 <p>However, if you're really worried, you can permanently turn off
3152 password caching. With an svn 1.0 client, just set 'store-auth-creds
3153 = no' in your run-time config file. With an svn 1.1 client or later,
3154 you can use the more narrowly-defined 'store-passwords = no' (so that
3155 server certs are still cached). More information on password cacheing
3156 is in chapter 6 of the <a
3157 href="http://svnbook.red-bean.com/nightly/en/index.html">"Nightly
3158 Build" Subversion book</a>, under
3159 <a href="http://svnbook.red-bean.com/nightly/en/svn.serverconfig.netmodel.html#svn.serverconfig.netmodel.credcache">
3160 "Client Credentials Caching".</a></p>
3162 <p>Lastly, we point out that CVS has been caching passwords for years
3163 in the .cvspass file. It may look like the passwords in .cvspass are
3164 encrypted, but in fact they're only lightly scrambled with an
3165 algorithm that's the moral equivalent to rot13. They can be cracked
3166 instantly. The only utility of the scrambling is to prevent users
3167 (like root) from accidentally seeing the password. Nobody's cared
3168 enough to do this for Subversion yet; if you're interested, send
3169 patches to the dev@ list.</p>
3171 </div>
3174 <div class="h3" id="bdb41-tabletype-bug" title="bdb41-tabletype-bug">
3175 <h3>I'm getting the error "svn: bdb: call
3176 implies an access method which is inconsistent with previous
3177 calls". How do I fix this?</h3>
3179 <p>Berkeley DB 4.1 has shown itself to be rather unstable - both 4.0
3180 and 4.2 are better. This error message is a symptom of one unique way
3181 in which 4.1 will sometimes break.</p>
3183 <p>The problem is that the database format field for one of the tables
3184 that make up a Subversion repository using the Berkeley DB backend has
3185 become corrupted. For unknown reasons, this is almost always the
3186 'copies' table, which switches from the 'btree' type to the 'recno'
3187 type. Simple recovery procedures are outlined below - if they do not
3188 succeed, you should contact the Subversion Users <a
3189 href="mailto:users@subversion.tigris.org">mailing list</a>.</p>
3191 <ul>
3192 <li>Ensure that no other processes will attempt to access your
3193 repository.</li>
3194 <li>Now, <b>back up your repository</b> to a tar or zip file or
3195 similar.</li>
3196 <li>Change to the <tt>db</tt> subdirectory of your repository.</li>
3197 <li><tt>rm __db.* log.*</tt></li>
3198 <li><tt>db_dump -p -r copies &gt; copies.dump</tt></li>
3199 <li>Now edit <tt>copies.dump</tt>. In the section near the top,
3200 change "<tt>type=recno</tt>" to "<tt>type=btree</tt>", and delete
3201 the line beginning "<tt>re_len=</tt>".</li>
3202 <li><tt>rm copies</tt></li>
3203 <li><tt>db_load copies &lt; copies.dump</tt></li>
3204 <li><tt>svnadmin dump .. &gt; ../../my-recovered.svndump</tt></li>
3205 <li>Now create a new repository, reload the dump file just produced,
3206 and copy across any custom hooks or configuration. Verify that the
3207 highest revision number in the new repository is what you think it
3208 should be.</li>
3209 </ul>
3211 </div>
3214 <div class="h3" id="hotcopy-large-repos" title="hotcopy-large-repos">
3215 <h3>I can't hotbackup my repository,
3216 svnadmin fails on files larger than 2Gb!</h3>
3218 <p>Early versions of APR on its 0.9 branch, which Apache 2.0.x and
3219 Subversion 1.x use, have no support for copying large files (2Gb+).
3220 A fix which solves the 'svnadmin hotcopy' problem has been applied and
3221 is included in APR 0.9.5+ and Apache 2.0.50+. The fix doesn't work
3222 on all platforms, but works on Linux.
3223 </p>
3225 </div>
3228 <div class="h3" id="hidden-log" title="hidden-log">
3229 <h3>I cannot see the log entry for the file
3230 I just committed. Why?</h3>
3232 <p>Assume you run '<tt>svn&nbsp;checkout</tt>' on a repository and
3233 receive a working copy at revision 7 (aka, r7) with one file in it
3234 called <tt>foo.c</tt>. You modify the file and commit it
3235 successfully. Two things happen:</p>
3237 <ul>
3238 <li>The repository moves to r8 on the server.</li>
3239 <li>In your working copy, only the file <tt>foo.c</tt> moves to r8.
3240 The rest of your working copy remains at r7.</li>
3241 </ul>
3243 <p>You now have what is known as a <i>mixed revision working copy</i>.
3244 One file is at r8, but all other files remain at r7 until they too are
3245 committed, or until '<tt>svn&nbsp;update</tt>' is run.</p>
3247 <pre> $ svn -v status
3248 7 7 nesscg .
3249 8 8 nesscg foo.c
3250 $</pre>
3252 <p>If you run the '<tt>svn&nbsp;log</tt>' command without any
3253 arguments, it prints the log information for the current directory
3254 (named '<tt>.</tt>' in the above listing). Since the directory itself
3255 is still at r7, you do not see the log information for r8.</p>
3257 <p>To see the latest logs, do one of the following:</p>
3259 <ol>
3260 <li>Run '<tt>svn&nbsp;log&nbsp;-rHEAD</tt>'.</li>
3261 <li>Run '<tt>svn&nbsp;log&nbsp;URL</tt>', where URL is the repository URL.</li>
3262 <li>Ask for just that file's log information, by running
3263 '<tt>svn&nbsp;log&nbsp;foo.c</tt>'.</li>
3264 <li>Update your working copy so it's all at r8, then run
3265 '<tt>svn&nbsp;log</tt>'.</li>
3266 </ol>
3268 </div>
3271 <div class="h3" id="bdb43-upgrade" title="bdb43-upgrade">
3272 <h3>After upgrading to Berkeley DB
3273 4.3 or later, I'm seeing repository errors.</h3>
3275 <p>Prior to Berkeley DB 4.3, <tt>svnadmin recover</tt> worked to upgrade a
3276 Berkeley DB repository in-place. However, due to a change in the behaviour
3277 of Berkeley DB in version 4.3, this now fails.</p>
3279 <p>Use this procedure to upgrade your repository in-place to Berkeley
3280 DB 4.3 or later:</p>
3282 <ul>
3284 <li>Make sure no process is accessing the repository (stop
3285 Apache, svnserve, restrict access via file://, svnlook, svnadmin,
3286 etc.)</li>
3288 <li>Using an <i>older</i> <tt>svnadmin</tt> binary (that is, linked to
3289 an older Berkeley DB):
3291 <ol>
3293 <li>Recover the
3294 repository: '<tt>svnadmin&nbsp;recover&nbsp;/path/to/repository</tt>'</li>
3296 <li>Make a backup of the repository.</li>
3298 <li>Delete all unused log files. You can see them by running
3299 '<tt>svnadmin&nbsp;list-unused-dblogs&nbsp;/path/to/repeository</tt>'</li>
3301 <li>Delete the shared-memory files. These are files in the
3302 repository's <tt>db/</tt> directory, of the form <tt>__db.00*</tt></li>
3304 </ol>
3305 </li>
3307 </ul>
3310 <p>The repository is now usable by Berkeley DB 4.3.</p>
3312 </div>
3315 <div class="h3" id="tiger-apr-0.9.6" title="tiger-apr-0.9.6">
3316 <h3>Why do I get occasional, seemingly inconsistent errors when checking
3317 out over http:// from a repository running on MacOS X 10.4 (Tiger)?</h3>
3319 <p>Note: this assumes the repository is being served by Apache 2.0.x.</p>
3321 <p>There is <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=34332"
3322 >a bug in APR 0.9.6</a> that is present when it is running on Tiger,
3323 and shows up when you attempt to check out a file larger than 64Kb.
3324 The resulting checkout fails, often with unpredictable error messages.
3325 Here are some examples of what you might see on the client side, the
3326 specific errors may differ for you:</p>
3328 <pre>
3329 svn: Invalid diff stream: [tgt] insn 1 starts beyond the target view position
3330 </pre>
3332 <pre>
3333 svn: Unexpected end of svndiff input
3334 </pre>
3336 <pre>
3337 svn: REPORT request failed on '/path/to/repository'
3338 svn: REPORT of '/path/to/repository/!svn/vcc/default': Chunk delimiter was invalid
3339 </pre>
3341 <p>There may also be errors in the Apache error_log, such as:</p>
3343 <pre>
3344 [error] Provider encountered an error while streaming a REPORT response. [500, #0]
3345 [error] A failure occurred while driving the update report editor [500, #190004]
3346 </pre>
3348 <p>To confirm the presence of this bug &nbsp;&mdash;&nbsp; assuming
3349 you have access to the machine that the repository is being served
3350 from &nbsp;&mdash;&nbsp; try checking out using a file:// URL, which
3351 will access the filesystem directly instead of going through Apache.
3352 If the resulting checkout completes successfully, then it is almost
3353 certain that this is the problem.</p>
3355 <p>Currently, the best solution is to upgrade to APR 1.2.0+.</p>
3357 <p>Alternately, you can rebuild Apache and Subversion from their
3358 respective sources, setting the following environment variable before
3359 running configure for Apache:</p>
3361 <pre>
3362 setenv ac_cv_func_poll no
3363 </pre>
3365 <p>or in Bourne shell syntax, like this:</p>
3367 <pre>
3368 ac_cv_func_poll=no; export ac_cv_func_poll
3369 </pre>
3371 <p>If you built APR / APRUTIL separately (i.e., you did not use the
3372 ones that come as part of the Apache tarball), you must set that
3373 environment variable before running configure for APR, as this is
3374 where the problem lies.</p>
3376 </div>
3379 <div class="h3" id="debian-libtool" title="debian-libtool">
3380 <h3>I can't build Subversion from working copy
3381 source on Debian GNU/Linux; I get errors at the final link
3382 stage. What's wrong?</h3>
3384 <p>If you see errors like this in the final link stage of a Subversion
3385 trunk source build:</p>
3387 <pre>
3388 /usr/local/apache2/lib/libaprutil-0.so.0: undefined reference to `db_create'
3389 /usr/local/apache2/lib/libaprutil-0.so.0: undefined reference to `db_strerror'
3390 </pre>
3392 <p>it might be because you're on a Debian GNU/Linux system and need to
3393 upgrade 'libtool'. (I've also heard that the Debian packagers had to
3394 tweak 'libtool' and that this may cause some problems for Subversion
3395 builds. But that's hearsay&nbsp;&mdash;&nbsp;I didn't have time to
3396 verify the details before writing this FAQ entry. However, see <a
3397 href="http://subversion.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=112617"
3398 >http://subversion.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=112617</a>
3399 and the <a
3400 href="http://subversion.tigris.org/servlets/BrowseList?list=dev&amp;by=thread&amp;from=435265"
3401 >thread</a> it spawned for a detailed discussion.)</p>
3403 <p>In any case, after encountering this problem on a Debian GNU/Linux
3404 system running a newly-dist-upgraded 'testing' distribution on 15 Nov
3405 2005, the solution was to build <a
3406 href="http://www.gnu.org/software/libtool/libtool.html">libtool&nbsp;1.5.20</a>
3407 from source, using the standard "./configure &amp;&amp; make &amp;&amp;
3408 sudo&nbsp;make&nbsp;install" recipe. After that, I did a 'make&nbsp;clean' in
3409 my Subversion working copy tree, './autogen.sh', './configure', 'make',
3410 and everything worked fine.</p>
3412 <p>Note that another report of these symptoms appeared at <a
3413 href="http://svn.haxx.se/dev/archive-2003-01/1125.shtml"
3414 >http://svn.haxx.se/dev/archive-2003-01/1125.shtml</a>, though the
3415 solution described here was not mentioned in that thread.</p>
3417 </div>
3420 <div class="h3" id="freebsd-listen-host" title="freebsd-listen-host">
3421 <h3>I'm using FreeBSD, and I've started svnserve, but it doesn't seem
3422 to be listening on port 3690.</h3>
3424 <p>Short answer: invoke <tt>svnserve</tt> with
3425 the <tt>--listen-host=0.0.0.0</tt> option.</p>
3426 <p>Slightly longer answer: FreeBSD daemons only listen on tcp6 by
3427 default; that option tells them to also listen on tcp4.</p>
3428 </div>
3430 <div class="h3" id="already-under-version-control" title="already-under-version-control">
3431 <h3>I can't add a directory
3432 because Subversion says it's "already under version control".</h3>
3433 <p>The directory you're trying to add already contains
3434 a <tt>.svn</tt> subdirectory, but it's from a different repository
3435 than the directory to which you're trying to add it. This probably
3436 happened because you used your operating system's "copy" command to
3437 copy one working copy into the current one.</p>
3439 The quick and dirty solution is to delete all <tt>.svn</tt>
3440 directories contained in the directory you're trying to add; this
3441 will let the "add" command complete. If you're using Unix, this
3442 command will delete <tt>.svn</tt> directories
3443 under <tt>dir</tt>:</p>
3444 <pre>
3445 find dir -type d -name .svn -exec rm -rf {} \;
3446 </pre>
3447 <p>However, you should ask yourself <em>why</em> you made this copy;
3448 and you should ensure that by adding this directory, you won't be
3449 making an unwanted copy of it in your repository.
3450 </p>
3452 </div>
3454 <div class="h3" id="slow-private-svnserve" title="slow-private-svnserve">
3455 <h3>Accessing non-public repositories
3456 via svnserve is really slow sometimes.</h3>
3458 <p>This often happens when APR is compiled to use <tt>/dev/random</tt>
3459 and the server is unable to gather enough entropy. If Subversion is the
3460 only application using APR on the server, you can safely recompile APR
3461 with the <tt>--with-devrandom=/dev/urandom</tt> option passed to
3462 <tt>configure</tt>. This should <b>not</b> be done on systems that use
3463 APR for other processes, however, as it could make other services
3464 insecure.</p>
3466 </div>
3468 <div class="h3" id="ssl-negotiation-error" title="ssl-negotiation-error">
3469 <h3>When performing Subversion operations involving a lot of data over
3470 SSL, I get the error <tt>SSL negotiation failed: SSL error:
3471 decryption failed or bad record mac</tt>.</h3>
3473 <p>This can occur due to a problem with OpenSSL 0.9.8. Downgrading to
3474 an older version (or possibly upgrading to a newer version) is known
3475 to fix this issue.</p>
3477 </div>
3479 <div class="h3" id="broken-subclipse" title="broken-subclipse">
3480 <h3>I get an error that says "This client is too old".</h3>
3482 You're using both an older (pre-1.4) version of the Subversion
3483 command-line client, and Subclipse. You recently upgraded Subclipse,
3484 and now your command-line client says
3486 <pre>
3487 svn: This client is too old to work with working copy
3488 '/path/to/your/working/copy'; please get a newer Subversion client
3489 </pre>
3491 This happened because Subversion's working-copy format changed
3492 incompatibly&mdash;the new version of Subclipse upgraded your working
3493 copy, so now your command-line program, which is old, cannot read it.
3494 (This problem isn't specific to Subclipse; it would also have happened
3495 if you'd used a command-line client that was 1.4 or newer, along with
3496 your older command-line client.)
3498 The fix is simply to upgrade your command-line client to 1.4 or newer.
3500 </div>
3502 <div class="h3" id="switch-problems" title="switch-problems">
3503 <h3>Why doesn't <tt>svn switch</tt> work in some cases?</h3>
3505 <p>In some cases where there are unversioned (and maybe ignored) items
3506 in the working copy, <tt>svn switch</tt> can get an error. The switch
3507 stops, leaving the working copy half-switched.</p>
3509 <p>Unfortunately, if you take the wrong corrective action you can end
3510 up with an unusable working copy. Sometimes with these situations,
3511 the user is directed to do <tt>svn cleanup</tt>. But the <tt>svn
3512 cleanup</tt> may also encounter an error. See <a
3513 href="http://subversion.tigris.org/issues/show_bug.cgi?id=2505">issue
3514 #2505</a>.</p>
3516 <p>The user can manually remove the directories or files causing
3517 the problem, and then run <tt>svn cleanup</tt>, and continue the switch, to
3518 recover from this situation.</p>
3520 <p>Note that a switch from a <i>pristine</i> clean checkout always
3521 works without error. There are three ways of working if you are using
3522 <tt>svn switch</tt> as part of your development process:</p>
3524 <ol>
3526 <li>Fully clean your working copy of unversioned (including ignored)
3527 files before switching. <br/><b>WARNING! This deletes all unversioned
3528 dirs/files. Be VERY sure that you do not need anything that will be
3529 removed.</b>
3531 <blockquote>
3532 <div><pre><code>
3533 # Check and delete svn unversioned files:
3534 svn status --no-ignore | grep '^[I?]' | sed 's/^[I?]//'
3535 svn status --no-ignore | grep '^[I?]' | sed 's/^[I?]//' | xargs rm -rf
3536 </code></pre></div>
3537 </blockquote>
3539 </li>
3541 <li>Keep a <i>pristine</i> clean checkout. Update that, then copy it,
3542 and switch the copy when a switch to another branch is desired.</li>
3544 <li>Live dangerously :).
3545 Switch between branches without cleaning up BUT if you encounter a switch error
3546 know that you have to recover from this properly.
3547 Delete the unversioned files and the directory that the error was reported on.
3548 Then "svn cleanup" if needed and then resume the switch.
3549 Unless you delete <em>all</em> unversioned files, you may have to repeat this
3550 process multiple times.</li>
3552 </ol>
3554 <p>Some examples are detailed
3555 <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=2505">here in issue 2505</a>.
3556 The problem is that the svn client plays it
3557 safe and doesn't want to delete anything unversioned.
3558 </p>
3560 <p>Two specific examples are detailed here to illustrate a problem like this.
3561 There are also other svn switch errors, not covered here, which you
3562 can avoid by switching only from a <em>pristine</em> checkout.</p>
3564 <ol>
3566 <li>If any directory has been moved or renamed between the branches, then
3567 anything unversioned will cause a problem.
3568 In this case, you'll see this error:
3569 <br/>
3570 <blockquote>
3571 <div><pre><code>
3572 wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
3573 svn: Won't delete locally modified directory '&lt;dir&gt;'
3574 svn: Left locally modified or unversioned files
3575 </code></pre></div>
3576 </blockquote>
3577 <p>Removing all unversioned files, and continuing the switch will recover from this.</p>
3578 </li>
3580 <li>If a temporary build file has ever been added and removed, then a switch
3581 in a repository with that unversioned file (likely after a build) fails.
3582 You'll see the same error:
3584 <blockquote>
3585 <div><pre><code>
3586 wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
3587 svn: Won't delete locally modified directory '&lt;dir&gt;'
3588 svn: Left locally modified or unversioned files
3589 </code></pre></div>
3590 </blockquote>
3592 <p>In this case, just removing the unversioned items will not recover.
3593 A cleanup fails, but svnswitch directs you to run "svn cleanup".</p>
3595 <blockquote>
3596 <div><pre><code>
3597 wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
3598 svn: Directory '&lt;dir&gt;/.svn' containing working copy admin area is missing
3599 wc/$ svn cleanup
3600 svn: '&lt;dir&gt;' is not a working copy directory
3601 wc/$ svn switch $SVNROOT/$project/branches/$ticket-xxx
3602 svn: Working copy '.' locked
3603 svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
3604 </code></pre></div>
3605 </blockquote>
3607 <p>Removing the directory (and all other unversioned files, to prevent
3608 "switch" from breaking on a similar error repeatedly), and continuing the switch
3609 will recover from this.</p>
3610 </li>
3612 </ol>
3614 <p>The TortoiseSVN cleanup error is a bit different. You might encounter this:
3615 </p>
3616 <blockquote>
3617 <div><pre><code>
3618 Subversion reported an error while doing a cleanup!
3619 &lt;dir&gt;/&lt;anotherdir&gt; is not a working copy directory
3620 </code></pre></div>
3621 </blockquote>
3623 <p>In each case here, the "svn switch" breaks leaving you with a half-switched
3624 working copy. "svn status" will show items with S for switched items (different
3625 from top directory), ! for directories with problems, and ~ for the files that are
3626 the problem (and with maybe L for locked). Like this:</p>
3627 <blockquote>
3628 <div><pre><code>
3629 wc/$ svn status
3631 ! &lt;dir&gt;
3632 S &lt;switched_things&gt;
3633 ~ &lt;dir&gt;/&lt;thing_that_is_now_unversioned&gt;
3634 </code></pre></div>
3635 </blockquote>
3637 </div>
3639 <div class="h3" id="long-paths" title="long-paths">
3640 <h3>In Windows, when doing an update with the command-line client, I
3641 get an error saying "The system cannot find the path specified"
3642 and suggesting that my working copy might be corrupt. But I can
3643 update with TortoiseSVN just fine. What's going on?</h3>
3645 <p>A careful examination of the Windows API documentation regarding <a
3646 href="http://msdn2.microsoft.com/en-us/library/aa365247.aspx#maximum_path_length"
3647 >Naming a File</a> reveals the most common reason why this happens. In
3648 short, you can address significantly longer path names when using the
3649 Unicode versions of the Windows path functions, and providing absolute
3650 path specifiers instead of relative path specifiers. Fortunately, the
3651 Apache Portable Runtime (APR) library that Subversion uses
3652 transparently converts absolute paths (like
3653 <tt>C:\WorkingCopy\file.txt</tt>) into the form required by the
3654 Windows APIs (<tt>\\?\C:\WorkingCopy\file.txt</tt>), and back again.
3655 <em>Unfortunately</em>, you only get these long-path benefits when
3656 using absolute paths.</p>
3658 <p>To see if path length is the reason for the problem you're seeing,
3659 try providing an absolute target path to the Subversion command-line
3660 client instead of a relative one (or none at all). In other words,
3661 instead of doing this:</p>
3663 <blockquote>
3664 <div><pre><code>
3665 C:\> svn up WorkingCopy
3666 </code></pre></div>
3667 </blockquote>
3669 <p>or this:</p>
3671 <blockquote>
3672 <div><pre><code>
3673 C:\> cd C:\WorkingCopy
3674 C:\WorkingCopy> svn up
3675 </code></pre></div>
3676 </blockquote>
3678 <p>do this:</p>
3680 <blockquote>
3681 <div><pre><code>
3682 C:\> svn update C:\WorkingCopy
3683 </code></pre></div>
3684 </blockquote>
3686 <p>If the problem goes away, congratulations &mdash; you've hit a
3687 Windows path length limitation. And now you know the workaround.</p>
3689 <p><strong>Why does this problem not affect TortoiseSVN?</strong>
3690 Because TortoiseSVN <em>always</em> provides absolute paths to the
3691 Subversion APIs.</p>
3693 <p><strong>Why, then, does the Subversion command-line client not
3694 always convert its input into absolute paths and use those?</strong>
3695 The Subversion developers have been operating under the principle
3696 that, for reasons of user experience, the display of paths in the
3697 tool's output should match the syntax of the paths provided as input.
3698 And while conversion to an absolute path from a relative one is a
3699 fairly trivial operation, the reverse transformation is fraught with
3700 complexities. (In other words, it's a hard problem not high on our
3701 priority list.)</p>
3703 </div>
3705 <div class="h3"
3706 id="working-copy-format-change" title="working-copy-format-change">
3707 <h3>I got an error saying "This client is too old to work with working
3708 copy '...' ". How can I fix it without upgrading Subversion?</h3>
3710 <p>Sometimes the working copy metadata format changes incompatibly
3711 between minor releases. For example, say you have a working copy
3712 created with Subversion 1.4.4, but one day you decide to try out
3713 Subversion 1.5.0. Afterwards, you attempt to switch back to 1.4.4,
3714 but it doesn't work&nbsp;&mdash;&nbsp;it just gives the above
3715 error.</p>
3717 <p>This is because 1.5.0 upgraded your working copy format to support
3718 some new features (in this case, changelists, the keep-local flag, and
3719 variable-depth directories). Although 1.4.4 doesn't know anything
3720 about these new features, it can at least recognize that the working
3721 copy format has been upgraded to something higher than it can
3722 handle.</p>
3724 <p>1.5.0 upgraded the working copy for a good reason: it realizes that
3725 1.4.4 does not know about these new features, and that if 1.4.4 were
3726 to meddle with the working copy metadata now, important information
3727 might be lost, possibly causing corruption (see <a
3728 href="http://subversion.tigris.org/issues/show_bug.cgi?id=2961" >issue
3729 #2961</a>, for example).</p>
3731 <p>But this automatic upgrade behavior can be annoying, if you just
3732 want to try out a new release of Subversion without installing it
3733 permanently. For this reason, we distribute a script that can
3734 downgrade working copies when doing so is safe:</p>
3736 <blockquote>
3737 <p><a
3738 href="http://svn.collab.net/repos/svn/trunk/tools/client-side/change-svn-wc-format.py"
3739 >http://svn.collab.net/repos/svn/trunk/tools/client-side/change-svn-wc-format.py</a></p>
3740 </blockquote>
3742 <p>Run that script with the "<tt>--help</tt>" option to see how to use
3743 it. As future versions of Subversion are released, we will try to
3744 keep this FAQ entry up-to-date with potential downgrade scenarios and
3745 their implications.</p>
3747 </div>
3749 </div>
3752 <div class="h2" id="developer-questions" title="developer-questions">
3753 <h2>Developer questions:</h2>
3754 <p/>
3756 <div class="h3" id="ramdisk-tests" title="ramdisk-tests">
3757 <h3>How do I run the regression tests in a
3758 RAM disk?</h3>
3760 <p>Test execution can be dramatically sped up by keeping Subversion
3761 test data on a RAM disk. On a Linux system, you can mount a RAM disk
3762 on the fly with the command:</p>
3764 <blockquote>
3765 <div><code>mount -t tmpfs tmpfs
3766 /path/to/src/subversion/tests/cmdline/svn-test-work
3767 -o uid=$USER,mode=770,size=32m</code></div>
3768 </blockquote>
3770 <p>Or, for a more permanent solution, add lines like the following in
3771 your <code>/etc/fstab</code> file:</p>
3773 <blockquote>
3774 <div><code>tmpfs /path/to/src/svn/subversion/tests/cmdline/svn-test-work
3775 tmpfs defaults,user,noauto,exec,size=32m</code></div>
3776 </blockquote>
3778 <p>The minimum required size for testing ramdisk is approximately 700MB.
3779 However, flagging your test targets for cleanup dramatically reduces
3780 the space requirements (as shown in the example configuration above),
3781 and thus your memory usage. Cleanup means more I/O, but since test
3782 data is in-memory, there will be no performance degradation. Example:</p>
3784 <blockquote><div><code>
3785 make check CLEANUP=true
3786 </code></div></blockquote>
3788 <p>See <a href="http://svn.haxx.se/dev/archive-2003-02/0068.shtml"
3789 >http://svn.haxx.se/dev/archive-2003-02/0068.shtml</a> for the
3790 original authoritative discussion on use of RAM disks.</p>
3792 </div>
3795 <div class="h3" id="dynamic-exe-debugging" title="dynamic-exe-debugging">
3797 <h3>How do I run a debugger on dynamic Subversion binaries without
3798 having to install them?</h3>
3800 <p>Before the <code>make install</code> step on unix-y systems,
3801 dynamically built "executables" in a Subversion source tree are
3802 actually libtool-generated shell scripts which re-link and run the
3803 real binary. As shown below, this complicates debugging:</p>
3805 <blockquote>
3806 <div><code>subversion$ gdb subversion/svn/svn</code></div>
3807 <div><code>... "/path/to/subversion/subversion/svn/svn": not in
3808 executable format: File format not recognized</code></div>
3809 </blockquote>
3811 <p>While this can be worked around by building using the
3812 <code>--disable-shared</code> argument to configure to statically link
3813 the binaries, or installing them and pointing your debugger at the
3814 installed version, it's often necessary or more expedient to be able
3815 to debug them right within your source tree.</p>
3817 <p>To do so, edit the last <code>exec</code> statement in the shell
3818 script to run the real binary in your debugger. With gdb, this
3819 amounts to replacing <code>exec "$progdir/$progname"</code> with
3820 <code>exec gdb --args "$progdir/$progname"</code>.</p>
3822 <p>This trick is also very useful when applied to the
3823 libtool-generated shell scripts for the white box tests.</p>
3825 </div>
3828 <div class="h3" id="avoiding-compiler-inlining"
3829 title="avoiding-compiler-inlining">
3831 <h3>How do I run a debugger on Subversion binaries without compiler
3832 inlining obfuscating the source?</h3>
3834 <p>By default, gcc will often optimize away private variables and
3835 functions, inlining the associated operations. This can complicate
3836 stepping through the code in a debugger.</p>
3838 <p>Work around this by turning off optimization during the
3839 <code>make</code> step on unix-y systems:</p>
3841 <blockquote>
3842 <div><code>subversion$ make EXTRA_CFLAGS=-O0</code></div>
3843 </blockquote>
3845 <p>(That's "dash ohh zero".) Alternately, you can make this change
3846 more permanent by running <code>configure</code> as follows:</p>
3848 <blockquote>
3849 <div><code>subversion$ ./configure --enable-debug</code></div>
3850 </blockquote>
3852 <p>For a production install, remember to undo this operation before
3853 installing Subversion from source, by re-running <code>make</code> or
3854 <code>configure</code> without the extra flag.</p>
3856 </div>
3859 </div>
3861 <div class="h2" id="references" title="references">
3862 <h2>References:</h2>
3863 <p/>
3865 <div class="h3" id="http-methods" title="http-methods">
3866 <h3>What are all the HTTP methods Subversion
3867 uses?</h3>
3869 <p>The Subversion client speaks a subset the WebDAV/DeltaV protocol to
3870 the mod_dav_svn server module. The short answer is:</p>
3872 <pre>
3873 OPTIONS, PROPFIND, GET, REPORT,
3874 MKACTIVITY, PROPPATCH, PUT, CHECKOUT, MKCOL,
3875 MOVE, COPY, DELETE, LOCK, UNLOCK, MERGE
3876 </pre>
3878 <p>The details of the protocol are documented here:</p>
3880 <a href="http://svn.collab.net/repos/svn/trunk/notes/webdav-protocol">http://svn.collab.net/repos/svn/trunk/notes/webdav-protocol</a>
3884 </div>
3887 <div class="h3" id="bikeshed" title="bikeshed">
3888 <h3>What's a 'bikeshed'?</h3>
3890 <p>See Poul-Henning Kamp's post to freebsd-hackers: <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING">http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING</a>.
3891 </p>
3893 </div>
3896 <div class="h3" id="pronounce" title="pronounce">
3897 <h3>How do you pronounce "Subversion"?</h3>
3899 <p>Jim Blandy, who gave Subversion both its name and repository
3900 design, pronounces "Subversion" <a href="http://svn.collab.net/repos/svn-committers/trunk/sounds/pronunciation/index.html">"Subversion"</a>.
3901 </p>
3903 </div>
3906 <div class="h3" id="baton" title="baton">
3907 <h3>What's a 'baton'?</h3>
3909 <p>Throughout Subversion's source code there are many references to
3910 'baton' objects. These are just <tt>void *</tt> datastructures that
3911 provide context to a function. In other APIs, they're often called
3912 <tt>void *ctx</tt> or <tt>void *userdata</tt> Subversion
3913 developers call the structures "batons" because they're passed around
3914 quite a bit.</p>
3916 </div>
3919 <div class="h3" id="def-wedged-repository" title="def-wedged-repository">
3920 <h3>What do you mean when you say that
3921 repository is 'wedged'?</h3>
3923 <p>wedged repository:</p>
3925 <blockquote>
3926 <p>A Subversion repository consists of two different internal parts, a
3927 working compartment and a storage compartment. A wedged repository is
3928 a repository where the working compartment is unaccessible for some
3929 reason, but the storage compartment is intact. Therefore, a wedged
3930 repository has not suffered any loss of data, but the working
3931 compartment has to be corrected before you can access the
3932 repository. See <a href="#stuck-bdb-repos">this</a> entry for details
3933 how to do that.</p>
3934 </blockquote>
3936 <p>corrupted repository:</p>
3938 <blockquote>
3939 <p>A corrupted Subversion repository is a repository where the storage
3940 compartment has been damaged, and therefore there is some degree of
3941 real data loss in the repository.</p>
3942 </blockquote>
3944 <p>You might also like to check The Jargon File's definition for
3945 <a href="http://catb.org/~esr/jargon/html/W/wedged.html">'wedged'</a>.
3946 </p>
3948 </div>
3950 </div>
3952 </div>
3953 </body>
3954 </html>