Renaming Folders

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
scaiferw
Posts: 83
Joined: Thu Mar 22, 2012 8:22 am

Renaming Folders

Post by scaiferw » Thu Oct 11, 2012 8:30 am

Hi;

I have a need to rename several top level folders in my repository, i.e. $/project_apple to $/project_orange. These are group folders; our developers put projects inside these folders, sometimes a couple of layers down.

How can I do this? Experiments with renaming or moving test folders show that checked out folders are no longer checked out after the change.

I'd like to make this as transparent as possible for my users, so if there's a way to rename their working folders at the same time that would be great. I've advised users from the outset to set a working folder only on the root level and let everything else inherit. I've observed that moving a folder in the repository will move it in my working folders as well.

Would appreciate any help you can give me or point me to.

Thanks,

Rob
Vault Standard Version 5.1.1.19215 -- Windows Server 2008 R2 -- SQL Server 2008 R2

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Renaming Folders

Post by lbauer » Thu Oct 11, 2012 11:41 am

You are correct that renaming a folder undoes the checkouts. That's because we keep track of checkout paths and when the folder name changes, that checkout path is no longer valid.

It would probably be best for you do to all the renaming, and then have users do a GET Latest from root. Both the repository folders and working folders should than have the new name.

Working folders which were explicity set and not inherited from root will keep the same name as when they were set. So users would have to manually change the working folder name and Get again, or set all working folders to inherit from root.
Linda Bauer
SourceGear
Technical Support Manager

scaiferw
Posts: 83
Joined: Thu Mar 22, 2012 8:22 am

Re: Renaming Folders

Post by scaiferw » Fri Oct 12, 2012 7:38 am

My users wouldn't normally do a get latest from root as they only work on certain projects within the tree. Wouldn't Get Latest Version give them everything in the repository?

Or do I warn them ahead of time that on a particular day the folders will be renamed and they'll have to check their projects out again from the new folder and, if necessary, move the files over from the old working folders to the new?

In my experimenting with renaming a test folder, it appears that it will rename the working folders unless I have the working folder open in Windows Explorer or, presumably, a file from the working folders open. Is this expected behaviour, or is it an incomplete understanding?

So I guess my questions are;

1. Would users do a get latest from root or simply check out the specific material they had checked out before?
2. Under what circumstances does renaming a file in the repository cause the user's working folders to be renamed?
3. Is there documentation or a best practices document for this process?
4. In my tests, I've renamed the folders from the Vault Client, is this the correct method?
5. Is there a command line tool or something else I should be using? I see the command line syntax vault.exe RENAME [options] repositorypath destrepositorypath but I don't know if this is simply the same as renaming in the client GUI or what effect it has on working folders.

Thanks,

Rob
Vault Standard Version 5.1.1.19215 -- Windows Server 2008 R2 -- SQL Server 2008 R2

scaiferw
Posts: 83
Joined: Thu Mar 22, 2012 8:22 am

Re: Renaming Folders

Post by scaiferw » Tue Oct 16, 2012 6:17 am

Bump.
Vault Standard Version 5.1.1.19215 -- Windows Server 2008 R2 -- SQL Server 2008 R2

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Renaming Folders

Post by Beth » Tue Oct 16, 2012 8:14 am

1. Would users do a get latest from root or simply check out the specific material they had checked out before?
  • They should be able to just get check out what they had before. No requirement to get everything. I think Linda mentioned from root, because if you work everywhere in the tree, then it's easier to deal with by having one working folder at root and get from there. That's not a requirement.
2. Under what circumstances does renaming a file in the repository cause the user's working folders to be renamed?
  • I need to discuss this with Linda. She will be back on Thursday.
3. Is there documentation or a best practices document for this process?
4. In my tests, I've renamed the folders from the Vault Client, is this the correct method?
  • I don't see anything wrong with that. If you're working in Visual Studio or Eclipse and have any links that rely on knowing the path, then you might want to perform your renaming there, so that all your links get updated during renames.

    You mentioned towards the beginning that you are renaming top-level folders and that the projects are a couple of layers down. That sounds like using the Vault GUI client for your renaming is the best choice in this case.
5. Is there a command line tool or something else I should be using?
  • There is a command-line tool, but it wouldn't necessarily be better for this use case. If you had a need to rename folders every day (don't do it...bad idea), then you would want to use the command line to write a script to do your renames daily.
Beth Kieler
SourceGear Technical Support

scaiferw
Posts: 83
Joined: Thu Mar 22, 2012 8:22 am

Re: Renaming Folders

Post by scaiferw » Tue Oct 16, 2012 10:55 am

Thanks Beth.

For reference, we don't use Visual Studio, and we don't typically use Vault for working with source code.

We use Vault to move packages - typically consisting of an .msi and install/remove scripts from development through QA to distribution and release.

We have first level folders like Development, QA, Pilot, Released. A package starts out as a subfolder two levels down in development, then when they are finished the folder is moved to QA for testing, then to Pilot, then to released.

So any staff member will only be working in a few different folders and nobody would be checking out or doing a 'get latest' from the root, though I've advised everyone to set working folder only on the root and let everything else inherit.

I want to have a good understanding of this before I do it, and the interaction between Vault and the Working folders is not yet clear to me. I'm sure many people have renamed folders before me so I was hoping there would be a known process.

My best guess would be something like this:

* Users close all files in working folders and ensure that no application, including Window Explorer, is accessing the folders.
* Users check in or undo checkout on all material that doesn't need to be checked out
* Vault admin captures list of all checked out files, sorted by users, from the Search pane
* Vault admin disconnects all user sessions with IISRESET
* Vault admin renames folder
* Users check out their material from new named folder.
* Users who have old and new folders in their working folders will checkout into the new folder and copy material across from old folder before deleting old folder.

Any comments would be welcome, and I'll wait for Linda's comments as well when she returns.
Vault Standard Version 5.1.1.19215 -- Windows Server 2008 R2 -- SQL Server 2008 R2

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Renaming Folders

Post by Beth » Tue Oct 16, 2012 4:40 pm

2. Under what circumstances does renaming a file in the repository cause the user's working folders to be renamed?
I see now that if a person does it themselves, it looks like they can just rename a folder even if it's set as their working folder and their local folder is renamed. But, in another check, when another user has performed the rename, and a second user is performing the get, but the level of the rename was at the level that they have set their working folder, then the rename isn't reflected in their working folder.
My best guess would be something like this:

* Users close all files in working folders and ensure that no application, including Window Explorer, is accessing the folders.
* Users check in or undo checkout on all material that doesn't need to be checked out
* Vault admin captures list of all checked out files, sorted by users, from the Search pane
* Vault admin disconnects all user sessions with IISRESET
* Vault admin renames folder
* Users check out their material from new named folder.
* Users who have old and new folders in their working folders will checkout into the new folder and copy material across from old folder before deleting old folder.
I don't think the last line will be needed. They will just want to double check what they have versus the repository, but based on what you've described so far, it sounds like they should match.
Beth Kieler
SourceGear Technical Support

Post Reply