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

RE: How to Switch, or Update, a file that exists only in a branch ?

From: Kerry, Richard <richard.kerry_at_atos.net>
Date: Fri, 20 Feb 2015 15:26:01 +0000

I don’t feel I've had a satisfactory answer to my original question yet.
Full details below, including mode details/use cases, but in short :

> I have a couple of files that exist only in a branch which I’d like to have within my Working
> Copy. If the files exist in the Head I can use “switch” to change the WC instance from
> the Head one to the branch one. But if the file is not in the Head I can’t do that as Switch
> only appears to work when a file is already in the WC as a checked-out file, and not if it
> is absent, or present but not Controlled.

> Or should I use Update to get this ? In which case what syntax ? It seems to want to update
> the whole folder to the Branch’s version.

Also, to follow up points in Les' response:
> If you put your documents in directories and branch the directory instead of doing individual file operations, you'll have a place to switch to when you want to access the contents of that branch directory.

I understand this.

> For source code work, this almost always makes sense.

Indeed - that's what I do for source code, where the folder makes sense as the "unit of interest".

> If you are working on some random collection of individual files with no natural structure for branch copies it might not.

That's pretty much the situation I have here.
Either it's a folder of miscellaneous configuration files or documents.
Sorry if that wasn't clear from my explanations (below).

Appreciatively,
Richard.

Richard Kerry
BNCS Engineer, SI SOL Telco & Media Vertical Practice

T: +44 (0)20 3618 2669
M: +44 (0)7812 325518
Lync: +44 (0) 20 3618 0778
Room G300, Stadium House, Wood Lane, London, W12 7TA
richard.kerry_at_atos.net

-----------------------------
I have a couple of files that exist only in a branch which I’d like to have within my Working
Copy. If the files exist in the Head I can use “switch” to change the WC instance from
the Head one to the branch one. But if the file is not in the Head I can’t do that as Switch
only appears to work when a file is already in the WC as a checked-out file, and not if it
is absent, or present but not Controlled.

Or should I use Update to get this ? In which case what syntax ? It seems to want to update
the whole folder to the Branch’s version.

Please can answers be phrased along the lines of either:

    Do it like this …..
Or

    It can’t be done, because …..

And not:

    You don’t want to do that.
Or

    Have you considered doing something completely different (without an explanation).

The situation I have is as follows:
The project I work on comprises a lot of folders with source code and documentation, and quite
a lot of configuration files.

When I am working in one area I am not bothered about others. That’s to say I want to pick
up changes there when they are done (using Update) and not need manually to merge them in
at a later time. That is why I don’t want to Branch the whole lot.

Use Case 1.
When I am working I replace some of the configuration files with my own altered versions specifically
for my own development/testing requirements.
I have a Branch which just has the files I want to use for testing. When the file has a corresponding
file in the Trunk I can just Switch to use my variant.
When the file does not have a corresponding one in the Trunk but does exist on the Branch
I want to pull in the Branch one. This is what I’m having trouble with.

Use Case 2.
I'm working on the documentation. In most cases the files are already there and I can just
Switch them and edit the Branch ones in place.
However I also need to add a few new docs. I could add them to the trunk but then others would
get them and I don't really want that yet - I'd rather they not appear for everyone else until
I merge my bug/development branch back in.
I can add them to the bug branch checked out in a separate WC. But I want to have them in
my main WC as there are index files that need to be changed to point at the new files. So
again I need to be able to get branch files into a WC mostly checked out from the trunk.

Previously I’ve used CVS for many years (actually CVSNT), and have used it in this manner.
Update Special (I think it is update –r) is equivalent to Switch and enables me to use the
file from the Branch where it already existed on the Trunk/Head. For the files that don’t
exist on the Trunk/Head I can Check-Out specifying the files and the Branch and they turn
up in the right place. And subsequent Updates respect the changed sources of the files.

Given that Subversion I usually presented as better than CVS in all ways I’m assuming it
can do this but I have yet to work out how to tell it to do so.

I’m sure I’ve read somewhere that SVN can handle a file being present on branch but not
the Trunk, so I expected to be able to do what I’ve described.

I hope someone can advise how I can do this.

Regards,
Richard.

PS. Using TortoiseSvn so also happy to receive answers indicating what to do within Tortoise.

PPS. I know I’ve already asked this a while ago but at the time I seem to have been spontaneously
unsubscribed to this list so I didn’t see any responses until much later at a time when
I wasn’t really able to respond.

-----------------------------

-----Original Message-----
From: Les Mikesell [mailto:lesmikesell_at_gmail.com]
Sent: Monday, January 26, 2015 4:42 PM
To: Kerry, Richard
Cc: users_at_subversion.apache.org
Subject: Re: How to Switch, or Update, a file that exists only in a branch ?

On Mon, Jan 26, 2015 at 10:00 AM, Kerry, Richard <richard.kerry_at_atos.net> wrote:
>
> Given that Subversion I usually presented as better than CVS in all ways I’m assuming it can do this but I have yet to work out how to tell it to do so.
>

The 'better' part about subversion is that it understands directories as projects and holds the contents together during atomic operations
like commits. If you put your documents in directories and branch
the directory instead of doing individual file operations, you'll have a place to switch to when you want to access the contents of that branch directory. For source code work, this almost always makes sense. If you are working on some random collection of individual files with no natural structure for branch copies it might not.

--
   Les Mikesell
     lesmikesell_at_gmail.com
Atos, Atos Consulting, Worldline and Canopy The Open Cloud Company are trading names used by the Atos group. The following trading entities are registered in England and Wales: Atos IT Services UK Limited (registered number 01245534), Atos Consulting Limited (registered number 04312380), Atos Worldline UK Limited (registered number 08514184) and Canopy The Open Cloud Company Limited (registration number 08011902). The registered office for each is at 4 Triton Square, Regent’s Place, London, NW1 3HG.The VAT No. for each is: GB232327983.
This e-mail and the documents attached are confidential and intended solely for the addressee, and may contain confidential or privileged information. If you receive this e-mail in error, you are not authorised to copy, disclose, use or retain it. Please notify the sender immediately and delete this email from your systems. As emails may be intercepted, amended or lost, they are not secure. Atos therefore can accept no liability for any errors or their content. Although Atos endeavours to maintain a virus-free network, we do not warrant that this transmission is virus-free and can accept no liability for any damages resulting from any virus transmitted. The risks are deemed to be accepted by everyone who communicates with Atos by email.
Received on 2015-02-20 16:26:31 CET

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.