can't get full file path name in client api history request

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

Moderator: SourceGear

Post Reply
icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

can't get full file path name in client api history request

Post by icnocop » Sun Oct 29, 2006 11:34 am

Hello,

SourceGear Vault v2.0.6

I am using the client api to get a history of changes successfully except for one major issue: the full file/folder path of the file/folder that changed.

the VaultHistoryItem has several properties but none of which contain the full file path name. The VaultHistoryItem.Name property usually only contains the name of the file that changed.

How can I get the full file/folder path of the file/folder that changed using the client api?

Thank you.
-Rami

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Mon Oct 30, 2006 8:50 am

Sample source code that can be used to reproduce the issue can be found here:

Sample Command line history query
http://support.sourcegear.com/viewtopic.php?t=450

In order to make this work with Vault v2.0.6:

1. Fix Vault API dll paths
2. replace "VaultLib.VaultHistoryQueryRequest"
with "VaultClientNetLib.ClientService.VaultHistoryQueryRequest"
3. replace "VaultLib.VaultUser" with "VaultClientNetLib.ClientService.VaultUser"
4. replace "VaultLib.VaultHistoryItem" with "VaultClientNetLib.ClientService.VaultHistoryItem"
5. removed ResourceManager and rm.GetString code

Any ideas?

Thank you,
-Rami

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Mon Oct 30, 2006 8:52 am

The manner in which the Vault client does this is it uses the folder where the query took place as a prefix to the contents of the name.
Jeff Clausius
SourceGear

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Mon Oct 30, 2006 9:31 am

Hi Jeff,

When I perform a recursive search in the entire repository:

VaultHistoryQueryRequest.Recursive = true
VaultHistoryQueryRequest.TopName = "$"

I am not able to get the full file/folder path of the VaultHistoryItems retrieved. The VaultHistoryItem.Name property only contains the file name and not the path in the repository.

What can I do?

Thank you,
-Rami

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Mon Oct 30, 2006 10:55 am

I forgot to take your version number into account. In Vault 3.x, history queries for me have the full path in both the name and historic name.

Look in the miscellaneous members for the object. Is there anything in there that may help?
Jeff Clausius
SourceGear

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Mon Oct 30, 2006 4:01 pm

Unfortunately no.

VaultHistoryItem.MiscInfo1 = null
VaultHistoryItem.MiscInfo2 = null

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Tue Oct 31, 2006 7:12 am

I have been brainstorming and the best option I have come up with is to recursively enumerate vault folders and perform a non-recursive history query on each folder.

I wonder how long it would take and how much stress it puts on the server.

Do I have a better option other than to upgrade to Vault v3?

Thank you.
Last edited by icnocop on Tue Oct 31, 2006 8:59 am, edited 1 time in total.

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Oct 31, 2006 8:55 am

If you run a recursive history on $/ from within the GUI client, does the History Explorer's results show the full path to items?
Jeff Clausius
SourceGear

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Tue Oct 31, 2006 9:02 am

No, the full path to items do not show up in the history explorer results.

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Oct 31, 2006 12:21 pm

OK.

About the only thing I could suggest is get the history, and then walk through the TreeCache's repository looking for matching IDs of files and folders. I don't think Vault 2.0.6 has a Find File Recursive by (Obj) ID otherwise I would recommend using that.
Jeff Clausius
SourceGear

Post Reply