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

locking externals

From: Neels Janosch Hofmeyr <neels_at_elego.de>
Date: Mon, 30 Mar 2009 02:19:28 +0200

Hi,

(Cc'ing TSVN because it's relevant to a mail on that list. This mail is
mainly directed at dev_at_subversion)

I'm investigating externals and found out that externals with a fixed
revision aren't locked as long as that fixed revision == HEAD.

While this may be a rare case for externals within the same repository, it
could be more common with (dir-)externals coming from another repos. Then
again, dir-externals need an explicit commit...

Anyway, it's rare but still wrong, right? In my elaborate reproduction
script (attached), this happens for both file- and dir-externals.

On svn.haxx.se, I only found a reference that trusts a fixed revision to
lock an external.

Should I add an issue for this?

Furthermore, I noticed that when I modify a fixed-revision external and
update, the modifications get "merged", causing a conflict for some strange
reason. Firstly, I think that conflict is probably erratic. Secondly, I'd
say svn should at least warn that something considered uncommittable was
modified, and maybe skip all "merge" attempts on a fixed revision external.

Should I add an issue for this, too/either?

~Neels

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1475609

svn, version 1.7.0 (dev build)
   compiled Mar 29 2009, 21:30:16

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

+ cd wc
+ mkdir -p trunk/dir
+ echo r1
+ echo r1
+ svn add trunk
A trunk
A trunk/dir
A trunk/dir/beta
A trunk/dir/alpha
+ svn ci -m 'repos 1, r1'
Adding trunk
Adding trunk/dir
Adding trunk/dir/alpha
Adding trunk/dir/beta
Transmitting file data ..
Committed revision 1.
+ echo r2
+ echo r2
+ svn ci -m 'repos 1, r2'
Sending trunk/dir/alpha
Sending trunk/dir/beta
Transmitting file data ..
Committed revision 2.
+ cd ..
+ cd wc2
+ mkdir trunk
+ echo r1
+ svn add trunk
A trunk
A trunk/file
+ svn ci -m 'repos 2, r1'
Adding trunk
Adding trunk/file
Transmitting file data .
Committed revision 1.
+ echo r2
+ svn ci -m 'repos 2, r2'
Sending trunk/file
Transmitting file data .
Committed revision 2.
+ svn mkdir pin
A pin
+ svn propset svn:externals -F - pin
property 'svn:externals' set on 'pin'
+ echo r3
+ svn ci -m 'repos 2, r3'
Adding pin
Sending trunk/file
Transmitting file data .
Committed revision 3.
+ svn propget svn:externals pin
-r1 file:////home/neels/hg/svn-tc/test/repos/trunk/dir dir.r1
-r2 file:////home/neels/hg/svn-tc/test/repos/trunk/dir dir.r2
-r1 ^/trunk/file file.r1
-r3 ^/trunk/file file.r3

+ svn up

Fetching external item into 'pin/dir.r1'
A pin/dir.r1/alpha
A pin/dir.r1/beta
Updated external to revision 1.

Fetching external item into 'pin/dir.r2'
A pin/dir.r2/alpha
A pin/dir.r2/beta
Updated external to revision 2.

Fetching external item into 'pin/file.r1'
E pin/file.r1
Updated external to revision 1.

Fetching external item into 'pin/file.r3'
E pin/file.r3
Updated external to revision 3.

Updated to revision 3.
+ ls pin/
dir.r1
dir.r2
file.r1
file.r3
+ cat pin/file.r1
r1
+ cat pin/file.r3
r3
+ svn info pin/file.r1
Path: pin/file.r1
Name: file.r1
URL: file:///home/neels/hg/svn-tc/test/repos2/trunk/file
Repository Root: file:///home/neels/hg/svn-tc/test/repos2
Repository UUID: e65a8dba-1cbb-11de-9333-5131c2f9df6e
Revision: 1
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 1
Last Changed Date: 2009-03-30 01:47:05 +0200 (Mon, 30 Mar 2009)
Checksum: 35a853e2b2b105502215358d4d3db9f7

+ svn info pin/file.r3
Path: pin/file.r3
Name: file.r3
URL: file:///home/neels/hg/svn-tc/test/repos2/trunk/file
Repository Root: file:///home/neels/hg/svn-tc/test/repos2
Repository UUID: e65a8dba-1cbb-11de-9333-5131c2f9df6e
Revision: 3
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 3
Last Changed Date: 2009-03-30 01:47:07 +0200 (Mon, 30 Mar 2009)
Checksum: 6dac75a33f3d65ad0ee50d102c53d3ef

+ ls pin/dir.r1
alpha
beta
+ ls pin/dir.r2
alpha
beta
+ cat pin/dir.r1/alpha
r1
+ cat pin/dir.r2/alpha
r2
+ svn info pin/dir.r1/alpha
Path: pin/dir.r1/alpha
Name: alpha
URL: file:///home/neels/hg/svn-tc/test/repos/trunk/dir/alpha
Repository Root: file:///home/neels/hg/svn-tc/test/repos
Repository UUID: e65537b6-1cbb-11de-ac62-6b2d61cfb4c8
Revision: 1
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 1
Last Changed Date: 2009-03-30 01:47:03 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:08 +0200 (Mon, 30 Mar 2009)
Checksum: 35a853e2b2b105502215358d4d3db9f7

+ svn info pin/dir.r2/alpha
Path: pin/dir.r2/alpha
Name: alpha
URL: file:///home/neels/hg/svn-tc/test/repos/trunk/dir/alpha
Repository Root: file:///home/neels/hg/svn-tc/test/repos
Repository UUID: e65537b6-1cbb-11de-ac62-6b2d61cfb4c8
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 2
Last Changed Date: 2009-03-30 01:47:04 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:08 +0200 (Mon, 30 Mar 2009)
Checksum: 4700bd67c00670c3e4085032d94cd2eb

Right, this is where the argument starts.

Edit file.r1 and commit, in spite of -r1 fixated above.
+ echo whoops

When I just commit, dir.* are skipped. But not file.*.
+ svn ci -m 'just for illustration'
Sending pin/file.r1
subversion/libsvn_client/commit.c:867: (apr_err=160028)
svn: Commit failed (details follow):
subversion/libsvn_repos/commit.c:124: (apr_err=160028)
svn: File '/trunk/file' is out of date

It says file.r1 is out of date. good.
+ svn revert pin/file.r1
Reverted 'pin/file.r1'

Now, edit file.r3 and commit, in spite of -r3 fixated above.
+ echo whoops
+ svn ci -m 'repos2, r4!?' pin/file.r3
Sending pin/file.r3
Transmitting file data .
Committed revision 4.

Wait! file.r3 is supposed to stay at -r3!

The commit went through because the external was at HEAD.

before the update, file.r3 shows -r4, after update back to -r3
+ cat pin/file.r3
whoops
+ svn info pin/file.r3
Path: pin/file.r3
Name: file.r3
URL: file:///home/neels/hg/svn-tc/test/repos2/trunk/file
Repository Root: file:///home/neels/hg/svn-tc/test/repos2
Repository UUID: e65a8dba-1cbb-11de-9333-5131c2f9df6e
Revision: 4
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 4
Last Changed Date: 2009-03-30 01:47:11 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:11 +0200 (Mon, 30 Mar 2009)
Checksum: 38091727c9837b65ee161f5563f0b3a4

+ svn up
U pin/file.r1
U trunk/file

Fetching external item into 'pin/dir.r1'
Updated external to revision 1.

Fetching external item into 'pin/dir.r2'
Updated external to revision 2.

Fetching external item into 'pin/file.r1'
U pin/file.r1
Updated external to revision 1.

Fetching external item into 'pin/file.r3'
U pin/file.r3
Updated external to revision 3.

Updated to revision 4.
+ cat pin/file.r3
r3
+ svn info pin/file.r3
Path: pin/file.r3
Name: file.r3
URL: file:///home/neels/hg/svn-tc/test/repos2/trunk/file
Repository Root: file:///home/neels/hg/svn-tc/test/repos2
Repository UUID: e65a8dba-1cbb-11de-9333-5131c2f9df6e
Revision: 3
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 3
Last Changed Date: 2009-03-30 01:47:07 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:13 +0200 (Mon, 30 Mar 2009)
Checksum: 6dac75a33f3d65ad0ee50d102c53d3ef

a commit to trunk/file was permitted.
+ cat trunk/file
whoops
+ svn info trunk/file
Path: trunk/file
Name: file
URL: file:///home/neels/hg/svn-tc/test/repos2/trunk/file
Repository Root: file:///home/neels/hg/svn-tc/test/repos2
Repository UUID: e65a8dba-1cbb-11de-9333-5131c2f9df6e
Revision: 4
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 4
Last Changed Date: 2009-03-30 01:47:11 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:12 +0200 (Mon, 30 Mar 2009)
Checksum: 38091727c9837b65ee161f5563f0b3a4

Let's see whether dirs do the same thing. Have to commit explicitly.
+ echo whoops
+ svn ci -m 'for illustration' pin/dir.r1
Sending pin/dir.r1/alpha
subversion/libsvn_client/commit.c:867: (apr_err=160028)
svn: Commit failed (details follow):
subversion/libsvn_repos/commit.c:124: (apr_err=160028)
svn: File '/trunk/dir/alpha' is out of date
+ echo whoops
+ svn ci -m 'repos 1, r3!?' pin/dir.r2
Sending pin/dir.r2/alpha
Transmitting file data .
Committed revision 3.
+ cat pin/dir.r2/alpha
whoops
+ svn info pin/dir.r2/alpha
Path: pin/dir.r2/alpha
Name: alpha
URL: file:///home/neels/hg/svn-tc/test/repos/trunk/dir/alpha
Repository Root: file:///home/neels/hg/svn-tc/test/repos
Repository UUID: e65537b6-1cbb-11de-ac62-6b2d61cfb4c8
Revision: 3
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 3
Last Changed Date: 2009-03-30 01:47:16 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:16 +0200 (Mon, 30 Mar 2009)
Checksum: 38091727c9837b65ee161f5563f0b3a4

+ svn up
U pin/file.r1
U pin/file.r3

Fetching external item into 'pin/dir.r1'
Updated external to revision 1.

Fetching external item into 'pin/dir.r2'
U pin/dir.r2/alpha
Updated external to revision 2.

Fetching external item into 'pin/file.r1'
U pin/file.r1
Updated external to revision 1.

Fetching external item into 'pin/file.r3'
U pin/file.r3
Updated external to revision 3.

Updated to revision 4.
+ cat pin/dir.r2/alpha
r2
+ svn info pin/dir.r2/alpha
Path: pin/dir.r2/alpha
Name: alpha
URL: file:///home/neels/hg/svn-tc/test/repos/trunk/dir/alpha
Repository Root: file:///home/neels/hg/svn-tc/test/repos
Repository UUID: e65537b6-1cbb-11de-ac62-6b2d61cfb4c8
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 2
Last Changed Date: 2009-03-30 01:47:04 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:17 +0200 (Mon, 30 Mar 2009)
Checksum: 4700bd67c00670c3e4085032d94cd2eb

+ cat ../wc/trunk/dir/alpha
r2
+ svn info ../wc/trunk/dir/alpha
Path: ../wc/trunk/dir/alpha
Name: alpha
URL: file:///home/neels/hg/svn-tc/test/repos/trunk/dir/alpha
Repository Root: file:///home/neels/hg/svn-tc/test/repos
Repository UUID: e65537b6-1cbb-11de-ac62-6b2d61cfb4c8
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 2
Last Changed Date: 2009-03-30 01:47:04 +0200 (Mon, 30 Mar 2009)
Text Last Updated: 2009-03-30 01:47:04 +0200 (Mon, 30 Mar 2009)
Checksum: 4700bd67c00670c3e4085032d94cd2eb

yes, they do.

Also note how an update on a modified revision-fixed external merges:
+ echo whoops
+ cat pin/file.r1
r1
whoops
+ svn st pin/file.r1
M X pin/file.r1
+ svn up --accept=mine-conflict pin/file.r1
G pin/file.r1
Updated to revision 4.
+ cat pin/file.r1
r1
whoops
+ svn info pin/file.r1
Path: pin/file.r1
Name: file.r1
URL: file:///home/neels/hg/svn-tc/test/repos2/trunk/file
Repository Root: file:///home/neels/hg/svn-tc/test/repos2
Repository UUID: e65a8dba-1cbb-11de-9333-5131c2f9df6e
Revision: 4
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 4
Last Changed Date: 2009-03-30 01:47:11 +0200 (Mon, 30 Mar 2009)
Checksum: 38091727c9837b65ee161f5563f0b3a4

+ svn st pin/file.r1
M X pin/file.r1
+ echo =====
=====
+ cd ..
+ ./k

Received on 2009-03-30 02:19:52 CEST

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

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