Successfully reported this slideshow.
Your SlideShare is downloading. ×

Sahana sharing your work with others

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
CMD Command prompts
CMD Command prompts
Loading in …3
×

Check these out next

1 of 14 Ad
Advertisement

More Related Content

Advertisement
Advertisement

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;ocuments and Settings&quot;USERNAME% </li></ul><ul><li>Windows 7: </li></ul><ul><li>cd sersUSERNAME% </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

Editor's Notes

  • 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

×