You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Miller, Eric" <Er...@amd.com> on 2007/11/01 14:36:37 UTC
svn switch question
I have the following working copy structure:
path/
path/A/
path/B/
path/C/
path/C has been switched to a tag url, tag1, and has been deleted in the
trunk. path/A has also been switched to tag2.
I want to switch path/C to the trunk - meaning I want it to go away.
% svn switch <trunk url>/path/C path/C
svn: Target path does not exist
Exit 1
How can I update path/C to reflect its proper status in the trunk
(deleted) without affecting path/A?
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Miller, Eric" <Er...@amd.com>.
> Steve Bakke wrote:
>
> This is the perfect scenario for tags which are 'labels' rather than
> cheap copies. It really illustrates how cheap copies really are
> different from labeling an arbitrary set of revisions. A lot of
> people would be happy if labels existed such that acrobatics such as
> decribed above would not be necessary.
Playing along here...
A simple example using labels:
svn label TAG1 path
<edit path/A, commit>
svn label TAG2 path
svn up -r TAG1 path/C
svn up -r TAG2 path/A
svn label TAG3 path
<in another working copy: trunk/delete path/C, trunk/delete path/A>
svn up -r HEAD path/C
Quite intuitive and compact.
Currently we would do:
svn cp path <TAG1 url>
<edit path/A, commit>
svn cp path <TAG2 url>
svn sw <TAG1 url> path/C
svn sw <TAG2 url> path/A
svn cp path <TAG3 url>
<in another working copy: delete trunk/path/C, delete trunk/path/A>
svn sw <TRUNK URL> path/C <= So far I don't think this is possible
Slinging around URLS is cumbersome and this fails to cover the use case
to boot.
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn switch question
Posted by Jeremy Pereira <je...@jeremyp.net>.
On 2 Nov 2007, at 14:28, Steven Bakke wrote:
>
>> Perhaps, but I still can't wrap my head around why he needs to do
>> this.
>> I can't answer his question, either, because I don't think what he
>> wants
>> is possible. I suspect my problem with this is due to the number of
>> years I've been working on Java or DotNet style projects.
>> Generally, I
>> don't see any value in arbitrarilly switching subprojects around.
>> Maybe
>> in a more low-level environment, like C, where such rigid
>> project/package definitions don't exist, this kind of mixed bag is
>> more
>> logical.
>>
>> Unfortunately, I have to step back from this problem because I cannot
>> offer any constructive ideas. I do want to understand the reason for
>> this scenario, though.
>
> I was thinking that I'd like to boil this problem down a bit further.
>
> Let's say I want to take a look at what is in another tag for one
> of my subdirectories:
>
> % cd <work>
> % svn switch <tag-URL> <work>/A
Why would you want to do that though? Surely, you'd just check out a
working copy of the tag into a different directory, not in your
source tree.
My feeling is that if you have a source tree where you might
legitimately want to pull in sub directories from different tags,
then the sub directories are actually independent components and
should be treated as such and referenced using svn:externals.
>
> (Look at the files and do whatever. No modifications)
>
> Now lets say I want to switch back to trunk, since I'm done looking
> at whatever was in that tag.
>
> % svn switch <trunk-URL> <work>/A
>
> When 'A' had been deleted from trunk in the interim, there is no
> way to do this. In my opinion, this is a flaw in subversion.
> Regardless of whether you understand the reasoning for it, I
> believe you should always be able to "undo" a switch successfully.
> I'm thinking this is somewhat related to the "depth" issue being
> dealt with in 1.5. Once a directory becomes part of the current
> working copy, it is impossible to remove it.
>
> Lastly, the common "solution" suggested for cases such as this is
> to do a fresh checkout. That's not really a good option in a
> number of cases. I should be able to issue a legal series of
> commands to get me back where I was considering that I didn't do
> any local modifications.
>
>> --
>> David
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Miller, Eric" <Er...@amd.com>.
> I was thinking that I'd like to boil this problem down a bit further.
>
> Let's say I want to take a look at what is in another tag for one of
> my subdirectories:
>
> % cd <work>
> % svn switch <tag-URL> <work>/A
>
> (Look at the files and do whatever. No modifications)
>
> Now lets say I want to switch back to trunk, since I'm done looking
> at whatever was in that tag.
>
> % svn switch <trunk-URL> <work>/A
>
> When 'A' had been deleted from trunk in the interim, there is no way
> to do this. In my opinion, this is a flaw in subversion.
> Regardless of whether you understand the reasoning for it, I believe
> you should always be able to "undo" a switch successfully. I'm
> thinking this is somewhat related to the "depth" issue being dealt
> with in 1.5. Once a directory becomes part of the current working
> copy, it is impossible to remove it.
>
> Lastly, the common "solution" suggested for cases such as this is to
> do a fresh checkout. That's not really a good option in a number of
> cases. I should be able to issue a legal series of commands to get
> me back where I was considering that I didn't do any local
> modifications.
This is a more than adequate summary of the issue, and I'd like to hear
from anyone if this is a known issue, and if it will be addressed in
1.5.
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn switch question
Posted by Steven Bakke <st...@amd.com>.
On Nov 2, 2007, at 9:11 AM, Bicking, David (HHoldings, IT) wrote:
>
>
>> -----Original Message-----
>> From: Steven Bakke [mailto:steven.bakke@amd.com]
>>
>> On Nov 1, 2007, at 3:25 PM, Bicking, David (HHoldings, IT) wrote:
>>
>>>> -----Original Message-----
>>>> From: Miller, Eric [mailto:Eric.Miller@amd.com]
>>>>
>>>>> I am a bit confused by the question. Are you saying that you have
>>>> these
>>>>> paths as a single working copy, then "switched" C and A to tags
>>>>> elsewhere in the repository, then deleted C from the
>>>> repository? Is
>>>>> "path" a subfolder of trunk and tag1 and tag2 subfolders of tags?
>>>>
>>>> Yes. This is the working copy:
>>>> path/ => trunk/path
>>>> path/A => tags/tag2/path/A
>>>> path/B => trunk/path/B
>>>> path/C => tags/tag1/path/C
>>>>
>>>> In a revision after tag1 was created the path trunk/path/C was
>>>> deleted.
>>>> Now I want path/C to be the same as trunk/path/C (deleted) without
>>>> affecting path/A.
>>>>
>>>> If I did a 'svn sw trunk/path path' then path/C would get deleted,
>>>> but it also forces path/A to the trunk as well, which I need to
>>>> avoid.
>>>>
>>>> Eric
>>>
>
>> This is the perfect scenario for tags which are 'labels' rather than
>> cheap copies. It really illustrates how cheap copies really are
>> different from labeling an arbitrary set of revisions. A lot of
>> people would be happy if labels existed such that acrobatics such as
>> decribed above would not be necessary.
>>
>> -steve
>>
>
> Perhaps, but I still can't wrap my head around why he needs to do
> this.
> I can't answer his question, either, because I don't think what he
> wants
> is possible. I suspect my problem with this is due to the number of
> years I've been working on Java or DotNet style projects.
> Generally, I
> don't see any value in arbitrarilly switching subprojects around.
> Maybe
> in a more low-level environment, like C, where such rigid
> project/package definitions don't exist, this kind of mixed bag is
> more
> logical.
>
> Unfortunately, I have to step back from this problem because I cannot
> offer any constructive ideas. I do want to understand the reason for
> this scenario, though.
I was thinking that I'd like to boil this problem down a bit further.
Let's say I want to take a look at what is in another tag for one of
my subdirectories:
% cd <work>
% svn switch <tag-URL> <work>/A
(Look at the files and do whatever. No modifications)
Now lets say I want to switch back to trunk, since I'm done looking
at whatever was in that tag.
% svn switch <trunk-URL> <work>/A
When 'A' had been deleted from trunk in the interim, there is no way
to do this. In my opinion, this is a flaw in subversion.
Regardless of whether you understand the reasoning for it, I believe
you should always be able to "undo" a switch successfully. I'm
thinking this is somewhat related to the "depth" issue being dealt
with in 1.5. Once a directory becomes part of the current working
copy, it is impossible to remove it.
Lastly, the common "solution" suggested for cases such as this is to
do a fresh checkout. That's not really a good option in a number of
cases. I should be able to issue a legal series of commands to get
me back where I was considering that I didn't do any local
modifications.
> --
> David
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Bicking, David (HHoldings, IT)" <Da...@thehartford.com>.
> -----Original Message-----
> From: Steven Bakke [mailto:steven.bakke@amd.com]
>
> On Nov 1, 2007, at 3:25 PM, Bicking, David (HHoldings, IT) wrote:
>
> >> -----Original Message-----
> >> From: Miller, Eric [mailto:Eric.Miller@amd.com]
> >>
> >>> I am a bit confused by the question. Are you saying that you have
> >> these
> >>> paths as a single working copy, then "switched" C and A to tags
> >>> elsewhere in the repository, then deleted C from the
> >> repository? Is
> >>> "path" a subfolder of trunk and tag1 and tag2 subfolders of tags?
> >>
> >> Yes. This is the working copy:
> >> path/ => trunk/path
> >> path/A => tags/tag2/path/A
> >> path/B => trunk/path/B
> >> path/C => tags/tag1/path/C
> >>
> >> In a revision after tag1 was created the path trunk/path/C was
> >> deleted.
> >> Now I want path/C to be the same as trunk/path/C (deleted) without
> >> affecting path/A.
> >>
> >> If I did a 'svn sw trunk/path path' then path/C would get deleted,
> >> but it also forces path/A to the trunk as well, which I need to
> >> avoid.
> >>
> >> Eric
> >
> This is the perfect scenario for tags which are 'labels' rather than
> cheap copies. It really illustrates how cheap copies really are
> different from labeling an arbitrary set of revisions. A lot of
> people would be happy if labels existed such that acrobatics such as
> decribed above would not be necessary.
>
> -steve
>
Perhaps, but I still can't wrap my head around why he needs to do this.
I can't answer his question, either, because I don't think what he wants
is possible. I suspect my problem with this is due to the number of
years I've been working on Java or DotNet style projects. Generally, I
don't see any value in arbitrarilly switching subprojects around. Maybe
in a more low-level environment, like C, where such rigid
project/package definitions don't exist, this kind of mixed bag is more
logical.
Unfortunately, I have to step back from this problem because I cannot
offer any constructive ideas. I do want to understand the reason for
this scenario, though.
--
David
*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn switch question
Posted by Steven Bakke <st...@amd.com>.
On Nov 1, 2007, at 3:25 PM, Bicking, David (HHoldings, IT) wrote:
>> -----Original Message-----
>> From: Miller, Eric [mailto:Eric.Miller@amd.com]
>>
>>> I am a bit confused by the question. Are you saying that you have
>> these
>>> paths as a single working copy, then "switched" C and A to tags
>>> elsewhere in the repository, then deleted C from the
>> repository? Is
>>> "path" a subfolder of trunk and tag1 and tag2 subfolders of tags?
>>
>> Yes. This is the working copy:
>> path/ => trunk/path
>> path/A => tags/tag2/path/A
>> path/B => trunk/path/B
>> path/C => tags/tag1/path/C
>>
>> In a revision after tag1 was created the path trunk/path/C
>> was deleted.
>> Now I want path/C to be the same as trunk/path/C (deleted)
>> without affecting path/A.
>>
>> If I did a 'svn sw trunk/path path' then path/C would get
>> deleted, but it also forces path/A to the trunk as well,
>> which I need to avoid.
>>
>> Eric
>
> First, my opinion on this: Rethink your methodology. I don't
> think it
> is a good idea to have a single working copy reference items from
> multiple branches while looking/acting like a representation of
> "trunk".
> Presumably, when you commit, these changes are going back to their
> respective locations in the repository anyway (since you switched the
> subfolders, so this is just a working copy convenience to you, right?
>
This is the perfect scenario for tags which are 'labels' rather than
cheap copies. It really illustrates how cheap copies really are
different from labeling an arbitrary set of revisions. A lot of
people would be happy if labels existed such that acrobatics such as
decribed above would not be necessary.
-steve
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn switch question
Posted by Rush Manbert <ru...@manbert.com>.
Miller, Eric wrote:
<snip>
>
> I'm going to update my nomenclature a bit to better distinguish the
> working copy paths from the repository urls.
>
> The updated contrived working copy:
> wc:wc_root/path/ => url:trunk/path (dir)
> wc:wc_root/path/A/ => url:tags/tag2/path/A (dir)
> wc:wc_root/path/B => url:trunk/path/B (file)
> wc:wc_root/path/C/ => url:tags/tag1/path/C (dir)
>
> The scenario:
> I created a working copy with subdirs pointing to a mixture of tags.
> This "perfect" mixture is what I need to create yet another tag. I do
> so and then wish to update a portion of the working copy
> (wc:wc_root/path/C) to the trunk. While I was creating my perfect
> mixture, someone deleted url:trunk/path/C (and that's ok with me). Lets
> say for the sake of argument that url:trunk/path/A has also been
> deleted.
>
> Restating the question: If url:trunk/path/C has been deleted how do I
> switch wc:wc_root/path/C to that deleted trunk state without doing the
> same to wc:wc_root/path/A, or any other innocent bystanders?
>
Can't you do this by removing wc:wc_root/path/C via:
rm -rf wc:wc_root/path/C
then do:
svn up wc:wc_root/path
? Or would that just check out everything from url:tags/tag1/path/C?
What I'm thinking is that svn will recognize that C is missing and try
to recreate it, but will it update it from the trunk (where it has been
deleted) or from the switched-to location?
- Rush
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Miller, Eric" <Er...@amd.com>.
> First, my opinion on this: Rethink your methodology. I don't think
it
> is a good idea to have a single working copy reference items from
> multiple branches while looking/acting like a representation of
"trunk".
Suffice it to say I wouldn't be doing this if I didn't have to.
> Presumably, when you commit, these changes are going back to their
> respective locations in the repository anyway (since you switched the
> subfolders, so this is just a working copy convenience to you, right?
If it helps, assume that the tag branches are immutable. This scenario
is not just a working copy convenience, see the description below.
> Now, I suggest that if you wish to continue doing it this way that you
> make each path (A, B, C) its own working copy (checkout each
> separately). If you'd done this before, you'd simply delete the "C"
> working copy and be done with it. The disadvantage is that you would
be
> doing a commit per path, rather than a commit at the root, but it
would
> more accurately represent what is actually happening.
No can do. path/ has versioned files in it and we all know that svn
can't check out individual files. Besides, losing the ability to commit
all changes from the working copy root node would not be acceptable.
I'm going to update my nomenclature a bit to better distinguish the
working copy paths from the repository urls.
The updated contrived working copy:
wc:wc_root/path/ => url:trunk/path (dir)
wc:wc_root/path/A/ => url:tags/tag2/path/A (dir)
wc:wc_root/path/B => url:trunk/path/B (file)
wc:wc_root/path/C/ => url:tags/tag1/path/C (dir)
The scenario:
I created a working copy with subdirs pointing to a mixture of tags.
This "perfect" mixture is what I need to create yet another tag. I do
so and then wish to update a portion of the working copy
(wc:wc_root/path/C) to the trunk. While I was creating my perfect
mixture, someone deleted url:trunk/path/C (and that's ok with me). Lets
say for the sake of argument that url:trunk/path/A has also been
deleted.
Restating the question: If url:trunk/path/C has been deleted how do I
switch wc:wc_root/path/C to that deleted trunk state without doing the
same to wc:wc_root/path/A, or any other innocent bystanders?
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Bicking, David (HHoldings, IT)" <Da...@thehartford.com>.
> -----Original Message-----
> From: Miller, Eric [mailto:Eric.Miller@amd.com]
>
> > I am a bit confused by the question. Are you saying that you have
> these
> > paths as a single working copy, then "switched" C and A to tags
> > elsewhere in the repository, then deleted C from the
> repository? Is
> > "path" a subfolder of trunk and tag1 and tag2 subfolders of tags?
>
> Yes. This is the working copy:
> path/ => trunk/path
> path/A => tags/tag2/path/A
> path/B => trunk/path/B
> path/C => tags/tag1/path/C
>
> In a revision after tag1 was created the path trunk/path/C
> was deleted.
> Now I want path/C to be the same as trunk/path/C (deleted)
> without affecting path/A.
>
> If I did a 'svn sw trunk/path path' then path/C would get
> deleted, but it also forces path/A to the trunk as well,
> which I need to avoid.
>
> Eric
First, my opinion on this: Rethink your methodology. I don't think it
is a good idea to have a single working copy reference items from
multiple branches while looking/acting like a representation of "trunk".
Presumably, when you commit, these changes are going back to their
respective locations in the repository anyway (since you switched the
subfolders, so this is just a working copy convenience to you, right?
Now, I suggest that if you wish to continue doing it this way that you
make each path (A, B, C) its own working copy (checkout each
separately). If you'd done this before, you'd simply delete the "C"
working copy and be done with it. The disadvantage is that you would be
doing a commit per path, rather than a commit at the root, but it would
more accurately represent what is actually happening.
*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Miller, Eric" <Er...@amd.com>.
> I am a bit confused by the question. Are you saying that you have
these
> paths as a single working copy, then "switched" C and A to tags
> elsewhere in the repository, then deleted C from the repository? Is
> "path" a subfolder of trunk and tag1 and tag2 subfolders of tags?
Yes. This is the working copy:
path/ => trunk/path
path/A => tags/tag2/path/A
path/B => trunk/path/B
path/C => tags/tag1/path/C
In a revision after tag1 was created the path trunk/path/C was deleted.
Now I want path/C to be the same as trunk/path/C (deleted) without
affecting path/A.
If I did a 'svn sw trunk/path path' then path/C would get deleted, but
it also forces path/A to the trunk as well, which I need to avoid.
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Bicking, David (HHoldings, IT)" <Da...@thehartford.com>.
> -----Original Message-----
> From: Miller, Eric [mailto:Eric.Miller@amd.com]
> I have the following working copy structure:
>
> path/
> path/A/
> path/B/
> path/C/
>
> path/C has been switched to a tag url, tag1, and has been
> deleted in the trunk. path/A has also been switched to tag2.
>
> I want to switch path/C to the trunk - meaning I want it to go away.
> % svn switch <trunk url>/path/C path/C
> svn: Target path does not exist
> Exit 1
>
> How can I update path/C to reflect its proper status in the trunk
> (deleted) without affecting path/A?
>
> Eric
I am a bit confused by the question. Are you saying that you have these
paths as a single working copy, then "switched" C and A to tags
elsewhere in the repository, then deleted C from the repository? Is
"path" a subfolder of trunk and tag1 and tag2 subfolders of tags?
--
David
*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn switch question
Posted by "Miller, Eric" <Er...@amd.com>.
> Since trunk/path/C is gone, this is not going to work right. So you
want
> to either switch path/C to the tag1 url, or since you know that
> trunk/path/C is gone, just use "rm -rf path/C"
Uhh.. wouldn't it then show up as missing?
% svn st path
! S path/C
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn switch question
Posted by Hari Kodungallur <hk...@gmail.com>.
On 11/1/07, Miller, Eric <Er...@amd.com> wrote:
>
> I have the following working copy structure:
>
> path/
> path/A/
> path/B/
> path/C/
>
> path/C has been switched to a tag url, tag1, and has been deleted in the
> trunk. path/A has also been switched to tag2.
I don't exactly understand the meaning of 'switched to' in this context.
- is /path under trunk? And if that is the case,
- move path/C from trunk/path/C to tag1 (moving essentially meaning
deleted from trunk/path/C)
- create a tag (copy) of trunk/path/A at tag2
I want to switch path/C to the trunk - meaning I want it to go away.
> % svn switch <trunk url>/path/C path/C
> svn: Target path does not exist
> Exit 1
>
> How can I update path/C to reflect its proper status in the trunk
> (deleted) without affecting path/A?
Since trunk/path/C is gone, this is not going to work right. So you want to
either switch path/C to the tag1 url, or since you know that trunk/path/C is
gone, just use "rm -rf path/C"
Thanks,
-Hari Kodungallur