3136 - refactoring and synchronization with the starteam plug-in for eclipse jim wogulis principal...

32
3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse Jim Wogulis Principal Architect, Borland Software Corporation

Upload: marjory-miller

Post on 05-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse

Jim WogulisPrincipal Architect, Borland Software Corporation

Page 2: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Introduction

In a team environment, how can users synchronize their local workspace with the most recent changes in the repository?

How do I check-in/update my local changes in to the repository? StarTeam standalone client has “file status” and tools to help

synchronize files, but sometimes they are insufficient. Common software development practice of “refactoring” makes the

problem harder and more frequent. Need to handle renames, moves, deletes as well as simple content

change. Don’t want the difficulty of synchronizing files to influence our use of

important software development practices.

Page 3: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

StarTeam Eclipse Plug-in

Provides access to artifacts in a StarTeam repository Server explorer to browse StarTeam repositories Allows you to map StarTeam projects to Eclipse projects Provides decorators to resources in package explorer Provides sophisticated tools for synchronization of local

and remote resources

Page 4: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Getting Started with the Plug-in

Download and install StarTeam Plug-in For Eclipse http://www.borland.com/downloads/download_starteam.html

To share an existing project: Create empty eclipse project Right click on project, select Team > Share Project… Select repository type “StarTeam” Choose the server, project, view and root folder

OR.. Open “Server Explorer View” Browse to desired StarTeam project/view/folder Right click “Check Out as Project…”

Page 5: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

StarTeam Status Decoration

Page 6: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

“Rollup” Status Label Decorations

Current

Incoming change

Outgoing change

Bidirectional change (both incoming and outgoing)

Unknown Status

Page 7: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Eclipse Synchronize List View

Based on selection in project explorer Lists resources in the selected container and below. Columns:

Resource name Status Action Dependencies

Can filter list entries to show only “Incoming” changes “Outgoing” changes or both.

Can toggle the list to show resources already in sync (“current”). Can run the synchronization process on all or just a selected set of

resources.

Page 8: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Synchronization List Entries

Can override default settings on a per-resource basis for: Lock Status Associated Process Item Revision Label Synchronization Action

Compare local resource changes with remote resource. Can perform synchronization on a single resource.

Page 9: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Status Values

Page 10: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Synchronization Actions

Synchronize Takes the “appropriate” action, e.g. does a check-in for an “Outgoing

Change”, will also synchronize any dependencies. Conform to Remote

Abandon local changes, e.g. “Force Check-out” Conform to Local

Ignores server changes, e.g. “Force Check-in” Mark as Merged

Tells the system that the local resource has been locally merged with the server changes.

No Action No action performed. This is selected by default for resources with

conflicting changes, e.g. “Merge”

Page 11: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Change Lock Status

Can override the lock status for each resource Unlocked Exclusive Non-exclusive Keep Current

Page 12: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Comment View

Used for associating check-in comments with resources Allows comments to be set at any time prior to

synchronization Supports a “Summary Comment” to be applied to all

resources on synchronization Supports comments for individual resources Supports specifying comments for newly added

resources

Page 13: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Comparison to Standalone StarTeam Client

Incoming content change (only) “Out of Date”

Outgoing content change (only) “Modified”

Incoming addition

Outgoing deletion“Missing”

Bidirectional content change (only)

“Merge”

Outgoing addition

Incoming deletion“Not in View”

Current “Current”

Unknown “Unknown”

Page 14: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Status Values not Available in Standalone Client

Incoming change involving a move and/or rename

Outgoing change involving a move and/or rename

Bidirectional addition

Bidirectional deletion

Bidirectional change involving a move and/or rename

Page 15: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Improvements over the Standalone Client

Not-in-View Folders File/Folder moves File/Folder renames File/Folder deletion

Page 16: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Not-in-View Folders

Commonly requested missing feature for StarTeam client

E.g. User adds a new Java package resulting in new local directories. The StarTeam client does not show those folders, nor any of the files they may contain.

Synchronization List in eclipse will show those folders and files as an “Outgoing addition”

Page 17: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

File/Folder Moves

With the StarTeam client a user can move an individual file from one folder to another but the change is performed immediately on the server.

No way to make multiple local moves and later update those changes on the server.

If another user moves a file to a new folder you will see the old file as “Not-in-View” and the new one as “Missing”.

If you were to delete the “Not-in-View” file you could lose your local changes.

Page 18: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

File/Folder Renames

Similar problems as move operation. Cannot accumulate local name changes and perform a

single update on all changes at a later time. If another user renames a file you have the “Not-in-View”

/ “Missing” problem.

Page 19: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

File/Folder Deletion

Standalone client requires a user to delete local and/or repository files in a single action.

If a user performs local-only deletion the file then the status becomes “Missing”.

If a different user deletes a file in the repository your local copy is marked “Not-in-View”.

“Not-in-View” is insufficient: could mean remotely deleted in which case the local file ought to be deleted OR it could mean local file was added and needs to be added to the repository.

Page 20: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Simple Content Change

Make a local change to a file’s content and check it in Status is “Modified” and is easily handled by standalone

StarTeam client.

Page 21: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Backing out a Local Change

Make local content change to a file Back out the change using “Conform to Remote”

Page 22: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Merge new Changes Locally

Make local changes to a file. Another user checks in a new version of the file. Use diff tool to merge changes locally Set synchronization action to “Mark as Merged”

Page 23: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Create a New Local Folder

Add a new Java package, creates one or more new local folders

Standalone StarTeam client is of no help at all. Known as the “Not-in-View” folder problem.

Page 24: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Simple Name Change

Refactor a file by changing its name. In eclipse I can build, run, test without committing the

rename change to the StarTeam repository. Standalone client doesn’t handle this well: my local file is

“Not-in-View” and remote file is “Missing”. I need to remember the new and old names and change it by hand.

Page 25: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Change Name and Package

Similar to previous scenario. In eclipse I can build, run, test without committing

changes. When ready I can make all changes at once. Standalone client doesn’t help. Now I need to both move

and rename files and remember names and locations.

Page 26: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Someone on the Team Refactors

Someone else moves and renames files/folders. In eclipse it is easy to synchronize these changes locally. Standalone client is harder: I end up with “Missing” and

“Not-in-View” files. Which do I delete locally?

Page 27: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Remote Delete

Simple refactoring: someone remotely deletes a file. In eclipse, I can tell this has happened and delete my

local copy. Standalone client the file becomes “Not-in-View”. I can’t

easily tell if that file is something I created which needs to be added or if it was deleted remotely and I need to delete it.

Page 28: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: We Both Add the Same File

Remote user and I add the same file name to the same folder.

In eclipse, this is shown as a conflict “Outgoing Addition, Incoming Addition”. Default action is “No action”. I’ll need to manually resolve this.

Standalone client would show the file status as “Unknown”. Tells us less information about what is going on, still need to resolve it manually.

Page 29: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Delete Local File

I locally delete a file that should no longer be in the project.

Eclipse shows this as an “Outgoing deletion”, default synchronization action is to delete the remote file.

In the standalone client I can delete it in the repository at the moment I delete it from disk, or delete it locally first. In the later case the file status is “Missing”, how can I know later on that I need to delete it? I may check out by mistake.

Page 30: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Remote Delete with Local Change

I’m working on a local file with changes, someone deletes file from the repository.

Eclipse shows this as a conflict: “Outgoing modification, Incoming Deletion”. Default action is “No action”, I need to resolve this manually.

Standalone client shows my local file as “Not-in-View”. Do I need to add it to the repository or delete it locally?

Even if I realize I need to delete it locally I can’t tell if I have local changes I will end up losing.

Page 31: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Scenario: Dependency Order

Have two similar files: Ball.java and Sphere.java and want to combine them in to one.

Move code from Sphere.java to Ball.java Delete Sphere.java Rename Ball.java to Sphere.java End up with one file Sphere.java whose history includes

Ball.java’s history. Synchronization action makes sure the content change,

delete and rename happen in the proper order.

Page 32: 3136 - Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation

Questions?

[email protected]