<<

FCM Code Management Tools A simplified interface to Subversion David Matthews, 23 September 2013

© Crown copyright 2013 Met Office What is FCM?

Effectively 2 separate systems • Code management

• Thin layer on top of Subversion to simplify its use and support our working practices • Make system

• Aimed at building modern Fortran code bases • Also supports C/C++

© Crown copyright 2013 Met Office Working practices Recommended but optional

• Trac ticket records need for change • Defect, enhancement? • Create branch • From head of trunk or from previous release? • Prepare code changes on branch • in latest changes from trunk? • Assign Trac ticket to reviewer when code ready • Merge changes back to trunk once reviewed • Core team only? • Resolve conflicts? Incentive to get changes committed. • Cross-link between & ticket • Close ticket • Delete branch? Note: Releases prepared on the trunk?

© Crown copyright 2013 Met Office Trac: part of FCM?

• Our chosen issue tracker • An essential part of our working practice • Very basic integration with FCM

Show branch differences using Trac: fcm branch- --trac / fcm bdi –t Display current source location using Trac: fcm www

© Crown copyright 2013 Met Office Why Trac?

• Flexible issue tracker • Roadmap feature for managing project releases • Provides record of all changes which went in a release (if used properly) • Built in wiki • Browser for viewing your Subversion repository • Browse the project tree / files • Examine revision logs • Examine change-sets • Timeline view which summarises changes to: • Tickets • Wiki pages • Subversion repository • Flexible ticket workflow • Supports our review process • Can be adapted to meet the requirements of bigger systems like the UM

© Crown copyright 2013 Met Office Repository keywords

• Configured in central FCM config file • Avoid the need to remember complicated URLs for projects, e.g. fcm co fcm:um-tr svn co svn://fcm2/UM_svn/UM/trunk • Allows projects to be referenced in a common way at different sites

• e.g. in fcm make config files

© Crown copyright 2013 Met Office Revision keywords

• Configured in the repository in a special fcm:revision property, e.g. vn6.6 = 4913 vn7.0 = 6163 • Easy way to identify the revision corresponding to a particular release • Important, for instance, when branching and in fcm make config files • Use where-ever you would have used a revision number

© Crown copyright 2013 Met Office Branch creation & naming

Default branch naming • Development branches, e.g. branches/dev/dmatt/vn6.1_DeepConvection fcm branch-create DeepConvection fcm:[email protected] • Test branches, e.g. branches/test/dmatt/r1234_DiagnoseProblem fcm bc –type=TEST DiagnoseProblem • Configurations, e.g. branches/pkg/Config/vn6.1_HadGEM1a fcm bc –t CONFIG NewConvectionScheme fcm:[email protected] • Releases, e.g. branches/pkg/Rel/vn6.1_BugFixes fcm bc –t REL BugFixes fcm:[email protected] • Further options: packages, shared branches

Naming configurable per repository using fcm:layout property

© Crown copyright 2013 Met Office Merging

• fcm merge supports merging of changes between branch and trunk (& vice-versa) • Essential since, prior to version 1.5, Subversion had no built-in support for merge tracking • fcm merge still not using Subversion built-in merge tracking • Not as good for our simple requirements (prior to svn 1.8?) • Maybe start using built-in capability later • Limitations of fcm merge: no proper support for • Reverse merges • Cherry picking

© Crown copyright 2013 Met Office Merging between trunk & branches

Jack’s

trunk

Jill’s

1 2 3 4 5 6 7 8 9 10 11

© Crown copyright 2013 Met Office Graphical differencing and merging

• Graphical diff uses xxdiff by default but easy to configure to use others tools such as tkdiff # Basic diff fcm diff --graphical / fcm di –g # Branch diff fcm branch-diff --graphical / fcm bdi –g • Currently only xxdiff supported for graphical merge but easy to extend # Conflict resolution fcm conflicts / fcm cf

© Crown copyright 2013 Met Office xxdiff 3-way merge

© Crown copyright 2013 Met Office Committing changes fcm

• Ensures your working copy is up to date • Working copy reflects how the repository will be after you have committed your changes - helps to ensure that any tests you have done prior to committing are valid • Always operates from the top of your working copy • Avoids you accidently committing a partial set of changes • Always commits all the changes in your working copy • Runs svn update after the commit to avoid confusion caused by your working copy containing mixed revisions

© Crown copyright 2013 Met Office Other commands

• fcm add --check • prompt user to add any un-versioned files • fcm rm –check • prompt users to remove any missing file • fcm branch-list • list branches (yours, another users, all users) • fcm branch-info • summary information about a branch – e.g. has it been merged to the trunk • fcm branch-delete • delete a branch • Simplified switch command, e.g. fcm sw trunk

© Crown copyright 2013 Met Office Why not just use Subversion?

Reasons • Subversion was (and still is) missing key features • Too many ways that Subversion can trip you up • Generally too difficult to use?

Downsides • Can’t use standard Subversion GUIs (unless you are careful) • Users with lots of experience of using Subversion (who are familiar with its quirks) may consider FCM unnecessary and don’t like being constrained in how they use Subversion

© Crown copyright 2013 Met Office fcm patch

• Allows collaborators to mirror the contents of the trunk from a master repository (including all the individual )

• Collaborators only ever make changes on branches • Also used to mirror important branches • Crude but effective (usually) • Essential to the way we collaborate (in the absence of shared repositories)

© Crown copyright 2013 Met Office Plans

• Upgrade to Subversion 1.8 (from 1.6) • Much improved working copy • Support externally facing Subversion repositories and Trac environments to improve collaboration • Will need to improve how FCM handles userids • Likely to rely on use of mirrored repositories to get around poor performance over wide-area networks • About to try this method of working with NEMO • Longer term, look at alternative technologies ()

© Crown copyright 2013 Met Office Questions and answers

© Crown copyright 2013 Met Office