Bzr & LaunchPad: Sharing Your Work with Others 3 July 2010, Sahana Camp Fran Boon [email_address]
Sharing your work with others <ul><li>Distributed Version Control: bzr </li></ul><ul><li>Branches hosted on LaunchPad </li...
Branches LaunchPad Merge proposal Trunk Local Branch Server Your Branch bzr merge bzr push bzr pull
LP: Public/Private Key <ul><li>Linux/Mac: </li></ul><ul><ul><li>ssh-keygen -t rsa </li></ul></ul><ul><li>Windows: </li></u...
LP: Public/Private Key <ul><li>Windows: </li></ul><ul><li>c: </li></ul><ul><ul><li>Windows XP: </li></ul></ul><ul><li>cd &...
Register an account on LP <ul><li>https://login.launchpad.net/+new_account </li></ul><ul><li>Add Public Key </li></ul><ul>...
Push a branch to LP <ul><li>bzr launchpad-login userid </li></ul><ul><li>cd web2py/applications/eden </li></ul><ul><li>bzr...
Merge with a branch on LP <ul><li>cd web2py/applications/eden </li></ul><ul><li>bzr merge lp:~winner/sahana-eden/test </li...
Resolve Conflicts <ul><li>If a file has been edited in the same place in different ways by 2 different people, then a Conf...
Subscribe to Branch <ul><li>Merge team selected </li></ul><ul><li>All users should subscribe to the Merge team’s branch </...
Pull a new branch from LP <ul><li>cd web2py/applications </li></ul><ul><li>bzr pull lp:~winner/sahana-eden/test winner </l...
Merge Proposal <ul><li>https://code.launchpad.net/~userid/sahana-eden/winner/+register-merge </li></ul><ul><li>Target Bran...
Branches LaunchPad Merge proposal Trunk Local Branch Server Your Branch bzr merge bzr push bzr pull
End
Upcoming SlideShare
Loading in …5
×

Sahana sharing your work with others

696 views
617 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
696
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Distributed Version Control allows faster development with more flexible options for sharing code between developers. Variant of famous Open Source phrase “Release Early, Release Often”
  • Normally you work in a local branch on your PC. You Merge changes in regularly from Trunk. You Push your changes to your branch on LaunchPad You Pull from LaunchPad to update your server sites
  • Required for LaunchPad: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair No need to create a new one if you already have one http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe
  • NB If Cygwin is installed then use the .ssh folder in your cygwin folder Windows Explorer cannot create folders which start with a dot, so need to create in the shell Save the files to the .ssh directory created NB Do Not just ‘Save Private Key’ as this will not work.
  • Copy/Paste from textbox rather than saved Public Key to avoid having to trim down to just what’s needed.
  • https://help.launchpad.net/Code/UploadingABranch
  • http://kdiff3.sourceforge.net
  • Sahana sharing your work with others

    1. 1. Bzr & LaunchPad: Sharing Your Work with Others 3 July 2010, Sahana Camp Fran Boon [email_address]
    2. 2. Sharing your work with others <ul><li>Distributed Version Control: bzr </li></ul><ul><li>Branches hosted on LaunchPad </li></ul><ul><li>“ Merge Early, Merge Often” </li></ul>
    3. 3. Branches LaunchPad Merge proposal Trunk Local Branch Server Your Branch bzr merge bzr push bzr pull
    4. 4. LP: Public/Private Key <ul><li>Linux/Mac: </li></ul><ul><ul><li>ssh-keygen -t rsa </li></ul></ul><ul><li>Windows: </li></ul><ul><ul><li>puttygen.exe </li></ul></ul><ul><ul><li>Generate </li></ul></ul><ul><ul><li>Move mouse to generate entropy </li></ul></ul><ul><ul><li>Do NOT close window </li></ul></ul>
    5. 5. LP: Public/Private Key <ul><li>Windows: </li></ul><ul><li>c: </li></ul><ul><ul><li>Windows XP: </li></ul></ul><ul><li>cd &quot;Documents and Settings&quot;USERNAME% </li></ul><ul><li>Windows 7: </li></ul><ul><li>cd UsersUSERNAME% </li></ul><ul><li>md .ssh </li></ul><ul><ul><li>Save Public Key: id_rsa.pub </li></ul></ul><ul><ul><li>Conversion menu | Export OpenSSH Key: id_rsa </li></ul></ul>
    6. 6. Register an account on LP <ul><li>https://login.launchpad.net/+new_account </li></ul><ul><li>Add Public Key </li></ul><ul><li>https://launchpad.net/people/+me/+editsshkeys </li></ul><ul><li>Windows: </li></ul><ul><ul><li>Copy/Paste from PuttyGen textbox </li></ul></ul><ul><li>Linux: </li></ul><ul><ul><li>~/.ssh/id_rsa.pub </li></ul></ul>
    7. 7. Push a branch to LP <ul><li>bzr launchpad-login userid </li></ul><ul><li>cd web2py/applications/eden </li></ul><ul><li>bzr add && bzr remove && bzr commit </li></ul><ul><li>bzr push lp:~userid/sahana-eden/test </li></ul>
    8. 8. Merge with a branch on LP <ul><li>cd web2py/applications/eden </li></ul><ul><li>bzr merge lp:~winner/sahana-eden/test </li></ul><ul><li>See changes: </li></ul><ul><li>bzr diff </li></ul><ul><li>Back-out: </li></ul><ul><li>bzr revert (filename) </li></ul>
    9. 9. Resolve Conflicts <ul><li>If a file has been edited in the same place in different ways by 2 different people, then a Conflict occurs. </li></ul><ul><li>Bzr creates 3 versions of the conflicted file: </li></ul><ul><li>xxx.BASE version of the file where both trees agreed </li></ul><ul><li>xxx.THIS version of the file in this branch </li></ul><ul><li>xxx.OTHER version of the file in other branch </li></ul><ul><li>bzr resolve filename </li></ul><ul><li>KDiff3 is a utility which can do a 3-way Diff. </li></ul>
    10. 10. Subscribe to Branch <ul><li>Merge team selected </li></ul><ul><li>All users should subscribe to the Merge team’s branch </li></ul><ul><li>Merge team should subscribe to all other branches </li></ul>
    11. 11. Pull a new branch from LP <ul><li>cd web2py/applications </li></ul><ul><li>bzr pull lp:~winner/sahana-eden/test winner </li></ul><ul><li>cd winner </li></ul><ul><li>(make changes) </li></ul><ul><li>bzr add && bzr remove && bzr commit </li></ul><ul><li>bzr push lp:~userid/sahana-eden/winner </li></ul>
    12. 12. Merge Proposal <ul><li>https://code.launchpad.net/~userid/sahana-eden/winner/+register-merge </li></ul><ul><li>Target Branch: </li></ul><ul><ul><li>Other </li></ul></ul><ul><ul><li>Choose – look for the winner’s userid </li></ul></ul>
    13. 13. Branches LaunchPad Merge proposal Trunk Local Branch Server Your Branch bzr merge bzr push bzr pull
    14. 14. End

    ×