Professional Documents
Culture Documents
Paul Dando
ECMWF User Support
Paul.Dando@ecmwf.int
Slide 1
Overview
1
Source Code Management
2
Perforce terminology
Perforce changelists
3
Depot structure
project group
//depot/main/ifs/ifs
... /prepifs/prepifs
... /hope/hope
... /...
4
Branching
//depot/user/<uid>/branch1 //depot/user/<uid>/branch3
//depot/user/<uid>/branch2
Integ
//depot/rel/ifs/CY32R2
//depot/rel/ifs/CY32R1
rate
main code line //depot/main/ifs
Commands p4 and q2
5
Getting help
p4 help edit
6
Creating a branch – what really happens
depot workspace
//depot/rel/ifs/CY31R1
copy <branch>
nt
//depot/user/<uid>/<branch> clie
y
cop
7
Referring to files in Perforce
/scratch/ms/gb/us2/p4w/us2_CY32R2_new/ifs/prog.F90
8
Editing a file
9
Deleting a file
z Reverting a file
- Removes the file from its changelist
- For files marked for edit or delete
the last submitted version of <file> is copied from the
depot to your client workspace
- For files marked for add
Slide
the local copy of the file remains in 20
your client workspace
until the next sync with the depot
10
Submitting your changes
p4 submit
z Submits changes made to the depot
- All changes since last check-in with p4 submit
- Can be one or many files
z Opens the change specification in an editor
- You must enter a change description to replace the line
<enter description here>
z Returns a changelist number
z Increments the version number of all files changed
- call_sl.F90#2 Version number
z Until p4 submit is issued all edits are
Slide local
21 and can be lost !
- Always check in any significant changes !
Change: new
//depot/user/us2/us2_CY32R2_new/ifs/nmi/vtran_new.F90 # add
//depot/user/us2/us2_CY32R2_new/ifs/nmi/vtran.F90 # edit
~ Slide 22
11
Finding out which files have changed
12
Adding projects to an existing branch
Slide 25
Copying a branch
13
Merging branches – resolving conflicts
z When two users edit the same file(s) at the same time,
their changes can conflict
z Perforce requires these conflicts to be resolved
- No changes to files in your changelist are submitted to the depot
until you resolve all conflicts
z The resolve process allows you to decide what should
be done
- Should your file overwrite the other user’s ?
- Should your changes be discarded in favour of the other user’s ?
- Should the two sets of changes be merged into one file ?
z When copying a branch you will need to overwrite
changes in the current branch withSlide
the27 those of the
branch being copied – “accept theirs”
Introduction to Perforce for IFS Slide 27
14
Un/syncing local workspace and depot
15
Entering your branch in prepIFS
Slide 31
z Individual
families per
project
Slide 32
16
Working with other project groups
Slide 33
17
p4v basic layout
Workspace Tabs
Slide 35
Demonstrations
Slide 36
18
Create new branch and change a file
exit
19
Further information
20