github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/doc/bazaar-usage.txt (about) 1 Bazaar Basics 2 ============= 3 4 An alternative to using `cobzr` is to use the normal `bzr` with light-weight 5 checkouts (see `bzr help checkouts`). 6 7 The first step is to create a repository that contains the juju-core trunk and 8 other working branches. 9 10 11 The Repository 12 ============== 13 14 See `bzr help repositories` for more info on repositories. 15 16 For this example, we'll use ~/src as a location for the repository. 17 18 $ cd ~/src 19 $ bzr init-repo juju-core 20 21 This will create a repository that has working trees (the actual files and 22 directories - see `bzr help working-trees`. 23 24 Now put trunk in there: 25 26 $ cd juju-core 27 $ bzr branch lp:juju-core trunk 28 29 30 Working in $GOPATH 31 ================== 32 33 Now that we have trunk of juju-core elsewhere, we now need to use it inside 34 $GOPATH. 35 36 These steps assume that you have juju-core already available in $GOPATH/src. 37 38 $ cd $GOPATH/src/github.com/juju/juju 39 $ bzr reconfigure --lightweight-checkout --bind-to ~/src/juju-core/trunk 40 41 Now when you look at that branch, you should see the following 42 43 $ bzr info 44 Lightweight checkout (format: 2a) 45 Location: 46 light checkout root: . 47 checkout of branch: /home/<you>/src/juju-core/trunk 48 shared repository: /home/<you>/src/juju-core 49 50 51 Making pushes easier 52 ==================== 53 54 You can specify information in the bazaar locations file which it uses to 55 determine the locations of the public and push locations for a branch. 56 57 Inside your ~/.bazaar/locations.conf file, add the following (not including 58 the curly braces). 59 60 {{{ 61 [/home/eric/src] 62 public_branch = bzr+ssh://bazaar.launchpad.net/~eric-the-viking 63 public_branch:policy = appendpath 64 push_location = lp:~eric-the-viking 65 push_location:policy = appendpath 66 }}} 67 68 And replace 'eric' with your login id, and 'eric-the-viking' with your 69 launchpad id. 70 71 The `appendpath` policy means that the directories under ~/src are added to 72 the path, so ~/src/juju-core/trunk would be pushed to (by default) 73 lp:~eric-the-viking/juju-core/trunk. What this means is that when you create 74 a new branch `new-work`, and go `bzr push` it goes to 75 `lp:~eric-the-viking/juju-core/new-work`. 76 77 78 Making a branch to work in 79 ========================== 80 81 Inside the $GOPATH/src/github.com/juju/juju directory, you can create a new 82 branch to work on using: 83 84 $ bzr switch -b new-work 85 86 This creates a new branch in `~/src/juju-core` called `new-work` and switches 87 the working tree to use that. Commits are now on that new branch, and push 88 sends it to launchpad to the `new-work` branch. 89 90 Everything else works the same. 91 92 93 Useful aliases 94 ============== 95 96 $ bzr alias commit="commit --strict" 97 98 This will mean that whenever you use commit, it adds the `--strict` flag. 99 What this means is that it will not allow you to commit if there are unknown 100 files. This is very useful when you create new files but forget to add them 101 prior to commit. 102 103 If you do have unknown files and want to override the strict behaviour for one 104 commit, then you can go... 105 106 $ bzr commit --no-strict -m "Blah blah" 107 108 109 Another useful alias is: 110 111 $ bzr alias ll="log --line -r-10..-1" 112 113 Will give you something like the following: 114 115 {{{ 116 $ bzr ll 117 956: Tim Penhey 2013-03-06 Add some documentation around lightweight checkout usage. 118 955: Dave Cheney 2013-03-05 [merge] environs/ec2: try to get tests working on raring 119 954: Roger Peppe 2013-03-04 [merge] juju: add NewConnFromState 120 953: Dimiter Naydenov 2013-03-01 [merge] state, uniter: Units now use charm URLs 121 952: Francesco Banconi 2013-03-01 [merge] Implement the API unexpose command. 122 951: William Reade 2013-03-01 [merge] environs: drop InstanceIdAccessor hack 123 950: Brad Crittenden 2013-02-28 [merge] Add the 'expose' command to the API. 124 949: John A Meinel 2013-02-28 [merge] revert only r943 125 948: William Reade 2013-02-28 [merge] history: rewind 126 947: Ian Booth 2013-02-28 [merge] Better unauthorised errors 127 }}} 128 129