[Urgent]Fetch the the path of a file at changeset without using the workspace
I need to know the full path of the file at changeset without the need to create instance of WorkSpaceConnection.
I have finished fetching the files I need at changeset,now I need to know the full path of this FileItem. IFileItem fileItem = (IFileItem) vm.fetchCompleteState(after, null); I have searched & posted at the forum and most of things I found is that I can use: configuration.determineAncestorsInHistory However in order to get the IConfiguration,I need for workspaceConnection which is not valid at my case. Can you give me a clue how could if that is applicable and how? Thanks. |
One answer
Conceptually, I don't think you can resolve the full path without a connection to a specific workspace or stream.
Consider: a file (foo.txt) might exist in your repository workspace at /myproject1/myfolder/foo.txt. However, I might have committed a change to *my* repository workspace that moves myfolder (and foo.txt underneath it) to a different project, myproject2, making its full path /myproject2/myfolder/foo.txt. The exact same file could have different full paths, depending on the context, and neither one is more "correct" than the other. In the Eclipse client, have you ever opened a change set in the Change Explorer view, only to be presented with some folders marked as <unresolved> and a message like "Some paths could not be resolved. Click here to fix this." (and 'clicking here' brings up a dialog where you can specify a repository workspace or stream to use to resolve the paths)? If I'm not mistaken, it's the same thing you're running into. You might want to take a step back and re-examine what you're trying to do, if you finding yourself needing to get a full path without a connection to a repository workspace or stream. Comments
Fatla 777
commented Feb 21 '13, 9:47 a.m.
Thanks John.
1
I think you'd need to fully define what you really mean by "the latest from the project area". A project area could contain multiple streams that might have the same file at different paths, just as in my example with repository workspaces above. If so, which one would you use?
1
John is correct. You'll need the workspace or stream. When you refer to latest in the project area on the server, it has to be in a stream that you consider the latest.
Initially thanks to you John and Tim.
Fatla 777
commented Feb 21 '13, 1:59 p.m.
Is it possible to get the stream name of a changeset !
No. Just as a file may exist in zero or more streams, a change set may also have been delivered to zero or more streams. It doesn't "belong" to any one stream.
Fatla 777
commented Feb 21 '13, 3:19 p.m.
Can you assist me into this:
showing 5 of 7
show 2 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.