comparison text/learning_mercurial_in_workflows.txt @ 110:8c8c8aaaaad7

learning in workflows: added sharing changes.
author Arne Babenhauserheide <bab@draketo.de>
date Wed, 22 Apr 2009 21:22:23 +0200
parents ed683ad3947f
children 8b51ceb2d36b
comparison
equal deleted inserted replaced
109:73cc830ff069 110:8c8c8aaaaad7
236 $ hg clone project integration 236 $ hg clone project integration
237 $ cd integration 237 $ cd integration
238 $ hg import change3.diff 238 $ hg import change3.diff
239 $ hg import change4.diff 239 $ hg import change4.diff
240 240
241 That's it. They can now test your changes in feature clones. If tehy accept it, they 241 That's it. They can now test your changes in feature clones. If they accept them,
242 they pull the changes into the main repository.
242 243
243 Note: The patchbomb extension automates the email-sending, but you don't need it for this workflow. 244 Note: The patchbomb extension automates the email-sending, but you don't need it for this workflow.
244 245
245 ==== Using a shared repository ==== 246 ==== Using a shared repository ====
246 247
247 -> bitbucket 248 Sending changes by mail might be the easiest way to reach people, but it creates additional workload: You have to send mails and then import the changes manually. Luckily there's an easier way which works quite well for smaller teams: The shared push repository.
249
250 Till now we transferred all changes either via email or via pull, but there's yet another way: pushing. As the name suggests it's just the opposite of pulling: You push your changes into another repository.
251
252 But to make use of it, we first need something we can push to.
253
254 By default "hg serve" doesn't allow pushing, since that would be a major security hole. You can allow pushing in the server, but that's no solution when you live in different timezones, so we'll go with another approach here: Using a shared repository on BitBucket. Doing so has a bit higher starting cost and takes a bit longer to explain, but it's well worth the effort spent.
255
256 For it you first need to setup a BitBucket Account. Just signup there and then hover your mouse over "Repositories". There click the item at the bottom of the opening dialog which say "Create new".
257
258 Give it a name and a description, and if you want to keep it hidden from the public, select "private".
259
260 $ firefox http://bitbucket.org
261
262 Now your repository is created and you see instructions to "push" code to it. for that you'll use a command similar to the following (just with a different URL):
263
264 $ hg push https://bitbucket.org/ArneBab/1w6/
265
266 (Replace the URL with the URL of your created repository. If your username is "Foo" and your repository is named "bar", the URL will be https://bitbucket.org/Foo/bar/)
267
268 Mercurial will ask for your BitBucket password, then push your code.
269
270 VoilĂ , your code is online.
271
272 Now it's time to tell all your collegues to sign up at BitBucket, too.
273
274 After that you can click the "Admin" tab of your created repository and add the names of your collegues on the right side under "Permission: Writers". Now they are allowed to push code to the repository.
275
276 (If you chose to make the repository private, you'll need to add them to "Permission: Readers", too)
277
278 If one of you now wants to publish changes, he'll simply push them to the repository, and all others get them by pulling.
279
280 Publish your changes:
281
282 $ hg push https://bitbucket.org/ArneBab/1w6/
283
284 Pull others changes into your local repository:
285
286 $ hg pull https://bitbucket.org/ArneBab/1w6/
287
288 People who join you in development can also just clone this repository, as if one of you were using "hg serve":
289
290 $ hg clone https://bitbucket.org/ArneBab/1w6/ 1w6
291
292 That local repository will automatically be configured to pull/push from/to the online repository, so new contributors can just use "hg push" and "hg pull" without an URL.
293