Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get changeset information from tfs using Java tfs-sdk

Tags:

java

eclipse

tfs

I tried with the below code

     TFSTeamProjectCollection tpc =
                new TFSTeamProjectCollection(URIUtils.newURI(COLLECTION_URL), credentials );

            VersionControlClient srcctrl = tpc.getVersionControlClient();
         Changeset[] chngset;
        try {
            chngset = srcctrl.queryHistory("http://******/tfs/SpectaTestCollection/", LatestVersionSpec.INSTANCE, 0, RecursionType.FULL, null, new DateVersionSpec("6/10/2014"), LatestVersionSpec.INSTANCE, Integer.MAX_VALUE, false, true, false, true);

             for(Changeset ch : chngset)
                {
                    System.out.println("Change Set ID : "+ ch.getChangesetID());
                    System.out.println("Owner : "+ ch.getOwner());
                }
        } catch (ServerPathFormatException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

But eveytime getting this error : There is no working folder mapping for D:\WorkSpace\test-workspace\tfsplay.game\http:********\tfs\SpectaTestCollection.

where "D:\WorkSpace\test -workspace\tfsplay.game" is my local workspace.

can anyone help me in guiding to the right way for doing this

like image 316
Muzammil Shareef Avatar asked Jul 15 '26 10:07

Muzammil Shareef


1 Answers

Don't pass a URL to the queryHistory method, pass a server path or a local path.

You're getting this error because you have passed a path that is not a server path (does not start with $/), so the system is trying to understand what server path you have mapped to http://...etc. Since that URL is also not a local path, you have gotten that error.

If you want to see all history, pass the server path $/.

like image 59
Edward Thomson Avatar answered Jul 18 '26 00:07

Edward Thomson