[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Can't check out single file from branch - svn client bug?

From: David Faure <faure_at_kde.org>
Date: 2005-05-06 00:47:50 CEST

svn, version 1.2.0 (Release Candidate 2)
   compiled May 4 2005, 21:24:54

Please see the commands below: how does one "switch" to a single file from a branch, when
the file isn't in the current directory?

On a completely new repository, I create trunk, add a file, create a branch, add a file:

$ svn mkdir file:///mnt/big/svnroot/trunk
Committed revision 2.
$ svn co file:///mnt/big/svnroot/trunk
Checked out revision 2.
$ cd trunk
$ touch file.cc
$ svn add file.cc
A file.cc
$ svn ci -m 'test'
Adding file.cc
Transmitting file data .
Committed revision 3.

$ svn mkdir file:///mnt/big/svnroot/branches/mybranch
Committed revision 4.
$ svn switch file:///mnt/big/svnroot/branches/mybranch
D file.cc
Updated to revision 4.
$ touch file-in-branch.txt
$ svn add file-in-branch.txt
A file-in-branch.txt
$ svn ci
Adding file-in-branch.txt
Transmitting file data .
Committed revision 5.

$ svn switch file:///mnt/big/svnroot/trunk
D file-in-branch.txt
A file.cc
Updated to revision 5.

Now, I want file.cc and file-in-branch.txt together in this directory. Surely svn
supports it, since it supports switching a single file, and remembering that
(with "S" in the svn status output).

But what's the command for achieving it? None of the commands below worked:

$ svn update file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt
Skipped 'file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt'
$ svn update file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt file-in-branch.txt
Skipped 'file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt'
At revision 5.
$ svn switch file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt file-in-branch.txt
svn: 'file-in-branch.txt' does not appear to be a working copy path
$ svn switch file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt
svn: Cannot replace a directory from within
$ svn co file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt file-in-branch.txt
svn: URL 'file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt' refers to a file, not a directory

If the file existed in both dirs, a simple svn switch would work... but why does it
require the file to exist in the trunk??

I believe this command should be the one that works:
$ svn switch file:///mnt/big/svnroot/branches/mybranch/file-in-branch.txt file-in-branch.txt
so the "'file-in-branch.txt' does not appear to be a working copy path" check is buggy?

David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri May 6 00:49:44 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.