[prev in list] [next in list] [prev in thread] [next in thread]
List: subversion-issues
Subject: [Issue 1014] New - svn add should fail w/ error when file to add is a symlink
From: issues () subversion ! tigris ! org
Date: 2002-11-25 18:57:49
[Download RAW message or body]
http://subversion.tigris.org/issues/show_bug.cgi?id=1014
*** Old
--- New
***************
*** 0 ****
--- 1,144 ----
+ +============================================================================+
+ | svn add should fail w/ error when file to add is a symlink |
+ +----------------------------------------------------------------------------+
+ | Issue #: 1014 Component: subversion |
+ | Status: NEW Version: current |
+ | Resolution: Platform: PC |
+ | Issue type: DEFECT OS/Version: Linux |
+ | Priority: P3 Subcomponent: libsvn_client |
+ +----------------------------------------------------------------------------+
+ | Assigned To: issues@subversion |
+ | Reported By: pll |
+ | QA Contact: issues@subversion |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | Milestone: TargetMilestone: --- |
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Description:
+
+ The official word from the subversion development team is that
+ subversion does not handle files which are symbolic links
+ within a repository.
+
+ However, 'svn add' does not complain when adding a file to the
+ repository when that file is a symbolic link to another file.
+ In fact, not only does it not complain that the user is doing
+ something wrong, it succeeds in adding the file, and reports success.
+
+ Additionally, 'svn commit' also succeeds in committing the the
+ symlink file to the repository, and reports success.
+
+ It isn't until the repository is either updated, or checked out
+ that it is noticable that something is wrong.
+
+ Problem:
+
+ Evidently, svn commit replaces the symlink file with a copy of
+ the real contents of the file in order to commit the file to
+ the repository. When the repository is then updated, 'svn up'
+ reports an error that some object with the same name as one of those
+ in the repository already exists. Indeed, there is a symlink in the
+ current working copy of the repository.
+
+ If the repository is checked out to a new locataion, i.e. a
+ new working copy, any files which were previously added as
+ symbolic links are now regular files. So, for example, if the
+ repository had 2 files in it, one of which was a symbolic link
+ to the other, upon check out of the repository, the new
+ working copy would have 2 files, both separate and distinct,
+ but identical, other than in name.
+
+ The result of this, ironically, is the exact case for which
+ symbolic links is used; to have one file known by multiple
+ names rather than have multiple identical files to keep track
+ of. Therefore, changes to one file, necessarilly require
+ identical changes in all other files which were previously
+ symbolic links.
+
+ The following session transcript details the process explained above:
+
+ pll@tater:/tmp/foo$ svn co http://bldsvr-eth1/svn/test
+ Checked out revision 0.
+ pll@tater:/tmp/foo$ ls -lrt
+ total 1
+ drwxr-xr-x 3 pll pll 1024 Nov 25 14:35 test
+ pll@tater:/tmp/foo$ cd test
+ pll@tater:/tmp/foo/test$ ls -l
+ total 0
+ pll@tater:/tmp/foo/test$ cp /etc/passwd foo
+ pll@tater:/tmp/foo/test$ ls -lrt
+ total 2
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:35 foo
+ pll@tater:/tmp/foo/test$ ln -s foo bar
+ pll@tater:/tmp/foo/test$ ls -lrt
+ total 2
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:35 foo
+ lrwxrwxrwx 1 pll pll 3 Nov 25 14:35 bar -> foo
+ pll@tater:/tmp/foo/test$ svn add *
+ A bar
+ A foo
+ pll@tater:/tmp/foo/test$ ls -lrt
+ total 2
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:35 foo
+ lrwxrwxrwx 1 pll pll 3 Nov 25 14:35 bar -> foo
+ pll@tater:/tmp/foo/test$ svn commit -m"created foo, bar symlink to foo"
+ pll's password:
+
+ Adding bar
+ Adding foo
+ Transmitting file data ..
+ Committed revision 1.
+ pll@tater:/tmp/foo/test$ ls -lrt
+ total 2
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:35 foo
+ lrwxrwxrwx 1 pll pll 3 Nov 25 14:35 bar -> foo
+ pll@tater:/tmp/foo/test$ svn up
+ svn: Obstructed update
+ svn: failed to add file 'bar': object of the same name already exists
+ pll@tater:/tmp/foo/test$ ls -lrt
+ total 2
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:35 foo
+ lrwxrwxrwx 1 pll pll 3 Nov 25 14:35 bar -> foo
+ pll@tater:/tmp/foo/test$ cd ..
+ pll@tater:/tmp/foo$ rm -rf test
+ pll@tater:/tmp/foo$ svn co http://bldsvr-eth1/svn/test
+ A test/bar
+ A test/foo
+ Checked out revision 1.
+ pll@tater:/tmp/foo$ cd test
+ pll@tater:/tmp/foo/test$ ls -l
+ total 4
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:36 bar
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:36 foo
+ pll@tater:/tmp/foo/test$ ln -s /etc/passwd
+ pll@tater:/tmp/foo/test$ ls -lrt
+ total 4
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:36 bar
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:36 foo
+ lrwxrwxrwx 1 pll pll 11 Nov 25 14:40 passwd ->
+ /etc/passwd
+ pll@tater:/tmp/foo/test$ svn add passwd
+ A passwd
+ pll@tater:/tmp/foo/test$ svn commit -m"added another symlink"
+ pll's password:
+
+ Adding passwd
+ Transmitting file data .
+ Committed revision 2.
+ pll@tater:/tmp/foo/test$ cd ..
+ pll@tater:/tmp/foo$ rm -rf test
+ pll@tater:/tmp/foo$ svn co http://bldsvr-eth1/svn/test
+ A test/bar
+ A test/foo
+ A test/passwd
+ Checked out revision 2.
+ pll@tater:/tmp/foo$ cd test
+ pll@tater:/tmp/foo/test$ ls
+ bar foo passwd
+ pll@tater:/tmp/foo/test$ ls -l
+ total 6
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:41 bar
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:41 foo
+ -rw-r--r-- 1 pll pll 1354 Nov 25 14:41 passwd
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@subversion.tigris.org
For additional commands, e-mail: issues-help@subversion.tigris.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic