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

How to update a single file to HEAD revision?

From: Ganssauge, Gottfried <Gottfried.Ganssauge_at_haufe.de>
Date: 2006-01-26 11:04:18 CET

I'm trying to update a single file in a sandbox checked out from a
branch to the current HEAD revision.
In CVS I would have done "cvs update -A file".
In Subversion I'm trying to use "svn update -rHEAD" but to no avail.
"svn update -r<numeric head revision>" doesn't work either.
So what's wrong?

To illustrate my point please consider the following sequence of
actions:
tempdir=$(mktemp -t -d)
trap "rm -rf $tempdir" 0 1 2 3 5 15
chmod 777 $tempdir
testrep=$tempdir/testrep
testrepurl=file://$testrep
svnadmin create $testrep
svn mkdir -m "Create branches" $testrepurl/branches
svn mkdir -m "Create tags" $testrepurl/tags
svn mkdir -m "Create trunk" $testrepurl/trunk
svn mkdir -m "Create project x" $testrepurl/trunk/x
cd $tempdir
svn co $testrepurl/trunk/x TRUNK
cd TRUNK
cat > 1 << EOF
1
2
3
EOF
svn add 1
svn commit -m "Create project file 1" 1
cd ..

svn mkdir -m "Create BRANCH_1" $testrepurl/branches/BRANCH_1
svn cp -m "Save trunk to new branch" $testrepurl/trunk/x
$testrepurl/branches/BRANCH_1

svn co $testrepurl/branches/BRANCH_1/x BRANCH
cd BRANCH
cat > 1 << EOF
1
2
4
EOF
svn commit -m "Change last line to 4 in Branch" 1
cd ..

cd TRUNK
cat > 1 << EOF
1
2
5
EOF
svn commit -m "Change last line to 5 in Head" 1
cd ..

cd BRANCH
svn update -rHEAD 1
diff ../TRUNK/1 1

This produces the following output

Committed revision 1.

Committed revision 2.

Committed revision 3.

Committed revision 4.
Checked out revision 4.
A 1
Adding 1
Transmitting file data .
Committed revision 5.

Committed revision 6.

Committed revision 7.
A BRANCH/1
Checked out revision 7.
Sending 1
Transmitting file data .
Committed revision 8.
Sending 1
Transmitting file data .
Committed revision 9.
At revision 9.
3c3
< 5

---
> 4
I would have expected to see no difference between the file generated by
"svn update -rHEAD" in the BRANCH directory and the file in TRUNK.
Cheers,
Gottfried 
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jan 26 11:05:39 2006

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.