GETLABEL after directory move

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

Moderator: SourceGear

Post Reply
staggart
Posts: 7
Joined: Tue Jun 23, 2009 4:57 pm

GETLABEL after directory move

Post by staggart » Mon Jul 06, 2009 5:22 pm

Hi,

Suppose I label a subtree named $/dev "12345" and later I move $/dev to $/xyz. What happens if I then do a GETLABEL on $/dev "12345"? Does it fail?

Thanks,

Scott

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

Re: GETLABEL after directory move

Post by lbauer » Tue Jul 07, 2009 8:26 am

I labeled a subfolder, moved it to a different parent directory, did a Get Label. Worked for me.

Does it work for you?
Linda Bauer
SourceGear
Technical Support Manager

staggart
Posts: 7
Joined: Tue Jun 23, 2009 4:57 pm

Re: GETLABEL after directory move

Post by staggart » Tue Jul 07, 2009 10:22 am

no, it doesn't work for me. I get:

running fortress command GETLABEL -verbose -makereadonly -merge overwrite -labelworkingfolder ./XXX $/ToolsAndUtilities/ATestFolderForGetLab
el 12345
<vault>
<error>
<exception>System.Exception: No object was found at the repository path: $/ToolsAndUtilities/ATestFolderForGetLabel
at VaultClientIntegrationLib.RepositoryUtil.FindVaultTreeObjectAtReposOrLocalPath(String testPath)
at VaultClientIntegrationLib.GetOperations.performLabelGet(String objectPath, String label, String labelSubItem, String labelWorkingFolde
r, String destPath, GetOptions go)
at VaultClientIntegrationLib.GetOperations.ProcessCommandGetLabelToTempWorkingFolder(String objectPath, String label, String labelSubItem
, GetOptions getOptions, String tmpWorkingFolder)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)</exception>
</error>
<result>
<success>False</success>
</result>
</vault>


------------------
I'd like to make sure we are doing the same things. I will show a sample of what I did - my names in the above cut and past are a bit different.

1) Create a folder named $/111/YYY with a file in it and add it to the repo.
2) Labeled YYY with "12345" (note that I tried different cases where I labelled both the directory I am interested in moving and the parent with the same results)
3) Moved YYY to $/222
4) Did a get label of $111/YYY with label of "12345". I got the error "object not found".

Now, I suppose if in step 4 above I did a get label of $/222/YYY 12345 it might work (maybe that's what you tried). That's not the interesting case to me. I am most interested in what happens if I try to retrieve a folder/file by a path that is no longer present in the current repo tree (i.e., it was available in a previously labelled version of the repo tree)

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

Re: GETLABEL after directory move

Post by lbauer » Wed Jul 08, 2009 3:02 pm

I tested your steps with the Command Line Client, plus did the same sequence of steps in the GUI Client, where I could see things more visually.

When I labeled YYY, then moved YYY to $/222, the label moved with it. There was no longer a recursive label when I selected $/111 in the GUI Client->Show Labels. That's probably why you got the error "object not found". There were no longer any labels under $/111.

When I did a Show Labels on $/222, it showed a recursive label on $/222/YYY, created at $111/YYY.

However, when I directly labeled $/111 (with YYY as its subfolder), moved YYY, and did a GetLabel on $/111, it did retrieve the YYY folder and contents. I'm not sure why you didn't get the same results when directly labeling the parent folder.

So in summary -- the label moves with the item that was directly labeled. If a folder is labeled, and an item in the folder moves, then the GetLabel properly retrieves all the items that were in the folder at the time it was labeled.
Linda Bauer
SourceGear
Technical Support Manager

staggart
Posts: 7
Joined: Tue Jun 23, 2009 4:57 pm

Re: GETLABEL after directory move

Post by staggart » Wed Jul 08, 2009 3:20 pm

OK, thanks. I did not try having the parent directory labeled. Your example seems to work. Thanks again.

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

Re: GETLABEL after directory move

Post by lbauer » Thu Jul 09, 2009 6:57 am

Let me know if you have additional questions.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply