Here is the symlink directory working just like the real directory when I add files and ask its status:
$> svn status real_directory/
A real_directory/new_file.txt
$> ln -s real_directory/ symlink
$> svn status symlink
A symlink/new_file.txt
$> svn status real_directory/
A real_directory/new_file.txt
$> touch symlink/another_new_file.txt
$> svn status symlink
? symlink/another_new_file.txt
A symlink/new_file.txt
$> svn add symlink/another_new_file.txt
A symlink/another_new_file.txt
$> svn status symlink/
A symlink/another_new_file.txt
A symlink/new_file.txt
However, this symlink directory fails on the commit command:
$> svn commit symlink/ -m "test commit"
svn: '/home/restcon' is not a working copy
svn: Can't open file '/home/restcon/.svn/entries': No such file or directory
Huh? That's weird. Svn certainly thinks that file exists when I do status
and add! Maybe it got deleted?
$> ls symlink/.svn/entries
symlink/.svn/entries
Nope, still there. Does it still have data in it?
$> ls -lha !$
ls -lha symlink/.svn/entries
-r--r--r-- 1 user group 14K 2009-12-18 06:36 symlink/.svn/entries
Yup, seems to be okay! Alright, forget trying to commit the directory by its symlink. What about just committing the directory by its real name?
$> svn commit real_directory/ -m "test commit"
Adding real_directory/another_new_file.txt
Adding real_directory/new_file.txt
Transmitting file data ..
Committed revision 1144.
Works fine. Why does svn work with add and status
on a symlinked directory, but not commit?
If I understand you right, that's true. It has the .svn directory.
>
> Looks like real_directory is the the top of your working copy, is this
> correct?
Oh, I see! Since a symbolic link is a filesystem file, svn thinks I'm tyring to commit *that symlink as a file* for a project in the current directory!
>
> If so, what seems to be happening is that SVN (which is capable of
> version-controlling symbolic links), is trying to commit your symbolic link,
That works!
> but the directory the link is in (/home/restcon) is not an SVN working copy
> directory, so the commit fails right away.
>
> Try to run 'svn commit symlink/*', which should work just fine.
Should I file this as a bug report? It seems to me that svn should be smart enough to figure this out -- although, that would take some thinking. Svn is able to handle other operations intuitively, such as status.
Should I file this as a bug report? It seems to me that svn should be smart enough to figure this out -- although, that would take some thinking. Svn is able to handle other operations intuitively, such as status.
No, this isn't a bug IMO. SVN is designed to support versioning symbolic links. Committing changes to/under it is a scenario where it has to break directory/link transparency because it's ambiguous what you're telling the client to do (i.e. creating the symbolic link vs. committing the changes in the location the new link is pointing to).
-- Steve Lefevre Lead Developer Restaurant Consultants, Inc. ( 614 ) 421-1441 slef...@restcon.net
>
> Telling the client to commit a symbolic link is fundamentally
> different from telling it to recursively commit changes to a
> directory, which is why the client behaves differently in each of
> these scenarios.
Right, giving those exact commands are fundamentally different, but what
I was trying to *express* was "commit the changes recursively under the
directory referenced by this symlink" -- and we know this.
What I'm arguing is that with a little additional decision-making, svn
could know what I was trying to express, and then you get consistent
behavior. Otherwise, why shouldn't svn give me the same error when I do
"status" or "update" on the symbolic link? It's smart enough to
'traverse' the symbolic link in those cases -- it seems to me that it
could also do this for "commit". The behavior is counter-intuitive: in
the cases of "status" and "update", it figures out that the symlink
points to a project and that I'm not referring to the current working
directory as a project, but then with commit ( and probably other
command ) it suddenly seems to "forget" that it links to a project,
whereas it knew it before. The human-facing interface is inconsistent.
I don't see the case where ambiguity would arise -- could you give an
example, please?
Steve
--
Steve Lefevre
Lead Developer
Restaurant Consultants, Inc.
( 614 ) 421-1441
slef...@restcon.net
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2431572
Please start new threads on the <us...@subversion.apache.org> mailing list.
To subscribe to the new list, send an empty e-mail to <users-s...@subversion.apache.org>.