Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[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.

0 votes



One answer

Permanent link
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.


1 vote

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.



showing 5 of 7 show 2 more comments

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 411

Question asked: Feb 21 '13, 6:25 a.m.

Question was seen: 6,129 times

Last updated: Feb 21 '13, 3:19 p.m.

Confirmation Cancel Confirm