[Urgent]Fetch the the path of a file at changeset without using the workspace
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
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
Thanks John.
I need to get the latest from the project area at server not from the anyone's workspace to avoid the issue you showed.
Is that possible?
I have set of parameters on my hand and I need to get the full path of the file within this changeset:
-Repository.
-ChangeSet
-Project Area
-FileItem
Thanks.
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?
If your project area will only ever contain one stream, you could just get a connection to that stream and use it to resolve the path, but that's a pretty big simplifying assumption to make.
1 vote
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.
1 vote
Initially thanks to you John and Tim.
As I am a newbie to RTC,my 2nd day,I had a misunderstanding at concepts.
Thanks to John who alerted me to those mistakes.
Now I would use the stream as well.
Um looping over my change set,so from the change set,I should know the stream and hence get the full directory of the file.
If you have any tips/snippets to do it,I would be thankful.
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.
Can you assist me into this:
https://jazz.net/forum/questions/103355/java-get-the-full-path-of-a-file-at-change-set
it may get answered as Tim said but I need to know each part in detail.