How to detect local changes in order to check-in and deliver
Eray İzgin (116●1●17●24)
| asked Jan 18 '12, 5:00 a.m.
edited May 24 '16, 11:45 p.m. by David Lafreniere (4.8k●7)
Hi,
I'm trying to determine how to detect local changes with scm. The scenario: -Make changes to a file or adding a file. -Then check whether there is a change or new file, and then check these changes into a new change set and deliver it. How can I determine local changes (changes that are not checked-in)? (I should copy files from another path to current workspace and determine changes) |
5 answers
This is the code I'm using to do it:
ILocation sboxPath = new PathLocation(wsPath); It's very similar to your, but if I don't use sbox.allShares() I obtain no local changes. Best Regards, Michele. Comments 1
Stefano Antoniazzi
commented May 11 '16, 10:29 a.m.
Just a comment on this: if you need to reuse the sandbox it's necessary not to leave a .jazzlock. I found that I may close "clean" with something like
sharingManager.deregister(sandbox, progressMonitor);
|
Geoffrey Clemm (30.1k●3●30●35)
| answered Jan 20 '12, 12:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you are using Eclipse or Visual Studio, there should be an
"Unresolved" folder which shows you your local changes. If you've made changes outside of Eclipse, you'll need to hit the "refresh" tool button, which will cause Eclipse to scan the sandbox files, to find any new changes. Cheers, Geoff On 1/18/2012 5:08 AM, erayizgin wrote: Hi, |
I work on RTC Client and I use plain-java-client libraries.
I try to determine local changes with this way. IWorkspaceSearchCriteria wsSearchCriteria = WorkspaceSearchCriteria.FACTORY.newInstance(); wsSearchCriteria.setKind(IWorkspaceSearchCriteria.WORKSPACES); wsSearchCriteria.setExactName("Example Workspace"); List<IWorkspaceHandle> workspaces = wm.findWorkspaces(wsSearchCriteria, 10, monitor); IWorkspaceHandle workspaceHandle = workspaces.get(0); IWorkspaceConnection workspaceLocal = wm.getWorkspaceConnection(workspaceHandle, null); IComponent currentComponent.... IWorkspaceConnection iwc = wm.getWorkspaceConnection(workspaceHandle, null); IPath copyFileAreaRoot = new Path("Z:\\RTC 3.0.1 Workspaces\\workspaceDeliverChangeset"); //it's my eclipse workarea folder. it's loaded folder in rtc component by click load on component. I hope I could tell. ILocation location = new PathLocation(copyFileAreaRoot); ISandbox sbox = sm.getSandbox(location, false); ILocalChangeManager lcm = FileSystemCore.getSharingManager().getLocalChangeManager(); ILocalChange[] localChange = lcm.getPendingChanges(workspaceLocal.getContextHandle(),currentComponent,test); I try to run this code, during debug process on ILocalChange org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array. Is this right way to handle not checkin codes with api? And next I will deliver them. (unresolved -> checkin-changeset-> deliver) I try to get only modified files and new files. |
I tried your code . But localChanges had 0, no local change.
Can you also share sample target and wsPath values? I tried wsPath like "Z:/RTC 3.0.1 Workspaces/workspaceWSBase" String target = "Z:/RTC 3.0.1 Workspaces/workspaceTargetBase" On debug process, ILocalChange[] localChanges line gave the message like.. "org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array." Thanks. |
Target must be the relative path inside the repository workspace load directory and is not equals to wsPath. I use these values:
D:\\temp\\rtcWS as wsPath /IMG as target (I've an IMG folder already versioned on my repository workspace). Michele. I tried your code . But localChanges had 0, no local change. |
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.