<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> <title></title> <meta name="author" content="James Blackwell <jblack@gnuarch.org>" /> <style type="text/css"> /* :Author: David Goodger (goodger@python.org) :Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to customize this style sheet. */ /* used to remove borders from tables and images */ .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { /* Override padding for "table.docutils td" with "! important". The right padding separates the table cells. */ padding: 0 0.5em 0 0 ! important } .first { /* Override more specific margin styles with "! important". */ margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } a.toc-backref { text-decoration: none ; color: black } blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { margin: 2em ; border: medium outset ; padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, div.warning p.admonition-title { color: red ; font-weight: bold ; font-family: sans-serif } /* Uncomment (and remove this text!) to get reduced vertical space in compound paragraphs. div.compound .compound-first, div.compound .compound-middle { margin-bottom: 0.5em } div.compound .compound-last, div.compound .compound-middle { margin-top: 0.5em } */ div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } div.dedication p.topic-title { font-weight: bold ; font-style: normal } div.figure { margin-left: 2em ; margin-right: 2em } div.footer, div.header { clear: both; font-size: smaller } div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; margin-left: 1.5em } div.sidebar { margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; clear: right } div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } div.system-messages { margin: 5em } div.system-messages h1 { color: red } div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } div.topic { margin: 2em } h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { margin-top: 0.4em } h1.title { text-align: center } h2.subtitle { text-align: center } hr.docutils { width: 75% } img.align-left { clear: left } img.align-right { clear: right } ol.simple, ul.simple { margin-bottom: 1em } ol.arabic { list-style: decimal } ol.loweralpha { list-style: lower-alpha } ol.upperalpha { list-style: upper-alpha } ol.lowerroman { list-style: lower-roman } ol.upperroman { list-style: upper-roman } p.attribution { text-align: right ; margin-left: 50% } p.caption { font-style: italic } p.credits { font-style: italic ; font-size: smaller } p.label { white-space: nowrap } p.rubric { font-weight: bold ; font-size: larger ; color: maroon ; text-align: center } p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } p.topic-title { font-weight: bold } pre.address { margin-bottom: 0 ; margin-top: 0 ; font-family: serif ; font-size: 100% } pre.literal-block, pre.doctest-block { margin-left: 2em ; margin-right: 2em } span.classifier { font-family: sans-serif ; font-style: oblique } span.classifier-delimiter { font-family: sans-serif ; font-weight: bold } span.interpreted { font-family: sans-serif } span.option { white-space: nowrap } span.pre { white-space: pre } span.problematic { color: red } span.section-subtitle { /* font-size relative to parent (h1..h6 element) */ font-size: 80% } table.citation { border-left: solid 1px gray; margin-left: 1px } table.docinfo { margin: 2em 4em } table.docutils { margin-top: 0.5em ; margin-bottom: 0.5em } table.footnote { border-left: solid 1px black; margin-left: 1px } table.docutils td, table.docutils th, table.docinfo td, table.docinfo th { padding-left: 0.5em ; padding-right: 0.5em ; vertical-align: top } table.docutils th.field-name, table.docinfo th.docinfo-name { font-weight: bold ; text-align: left ; white-space: nowrap ; padding-left: 0 } h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { font-size: 100% } ul.auto-toc { list-style-type: none } </style> </head> <body> <div class="document"> <table class="docinfo" frame="void" rules="none"> <col class="docinfo-name" /> <col class="docinfo-content" /> <tbody valign="top"> <tr class="field"><th class="docinfo-name">title:</th><td class="field-body">How to Locally Branch a Project with Arch</td> </tr> <tr class="field"><th class="docinfo-name">license:</th><td class="field-body">General Public License, V2</td> </tr> <tr class="field"><th class="docinfo-name">copyright:</th><td class="field-body"><ol class="first upperalpha simple" start="3"> <li>2004, 2005 Canonical Ltd.</li> </ol> <div class="last system-message"> <p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">../../bazaar-docs/src/LocallyBranchingAProject.rst</tt>, line 3)</p> Cannot extract compound bibliographic field "copyright".</div> </td> </tr> <tr><th class="docinfo-name">Author:</th> <td>James Blackwell <<a class="reference external" href="mailto:jblack@gnuarch.org">jblack@gnuarch.org</a>></td></tr> <tr class="field"><th class="docinfo-name" colspan="2">original-location:</th></tr> <tr><td> </td><td class="field-body"><a class="reference external" href="mailto:jblack@gnuarch.org--2004/bazaar-docs--initial--1.1">jblack@gnuarch.org--2004/bazaar-docs--initial--1.1</a></td> </tr> </tbody> </table> <p>If you are reading this howto, then you have decided to create a local branch off of a publically available archive. In order to use this mini-howto, you are expected to understand how to resolve minor conflicts. In this case, you have become interested in maintaining a localized version of "TuxDucks". The development lead, Tux, has made his archive, tux@penguin.org--2004 available at <a class="reference external" href="http://tux.org/2004tuxarchive">http://tux.org/2004tuxarchive</a>.</p> <p>As with always, the first thing you should do is to make sure that your arch user id is set. Your arch user id is used to identify changesets that are committed by you. Setting your arch userid is just as simple as telling arch what your email address is:</p> <pre class="literal-block"> $ baz my-id "John Doe <john@isp.com>" </pre> <p>Now, we need to tell arch where Tux's archive is. We perform this with the register-archive command:</p> <pre class="literal-block"> $ baz register-archive http://tux.org/tux@penguin.org--2004 Registered archive tux@penguin.org--2004 </pre> <p>If we like, we can take a quick look at Tux's archive, to see what's in it:</p> <pre class="literal-block"> $ baz rbrowse tux@penguin.org--2004/ tux@penguin.org--2004 tuxducks tuxducks--mainline tuxducks--mainline--1 base-0 .. patch-48 </pre> <p>In more established archives, often you'll see a lot of categories, branches and versions. In this case though, Tux likes things simple, and he only has one version in his archive, "tuxducks--mainline--1".</p> <p>However, before we go any further, lets set up our own archive, so that we have a place where we can commit our patches, and make it our default archive:</p> <pre class="literal-block"> $ baz register-archive john@isp.com--tuxducks /home/john/tuxducksarchive $ baz my-default-archive john@isp.com--tuxducks </pre> <p>Now that we have our own archive. If we want to make a branch of tuxducks, then we can use the branch command in order to make our own branch (which we can commit to, merge into, etc)</p> <pre class="literal-block"> $ baz get tux@penguin.org--2004/tuxducks--mainine tuxducks $ cd tuxducks $ baz branch john@isp.com--tuxducks--1 $ baz commit -s"Starting up my local branch of tuxducks" </pre> <p>This works great for this working copy, but what if we delete this working copy and want another one (or perhaps we want two working copies). That's no problem. We can get a new working copy by running:</p> <pre class="literal-block"> $ baz get tuxducks--mine--1 tuxducks </pre> <p>Sure enough, baz went ahead and got you a new working copy (in cvs called a "checkout") and placed it into the tuxducks dir. Now, you can edit the code, commit changes, so forth and so on. Its as if you have your very own secret fork of tuxducks!</p> <p>But here's a thought; while we're working on our own version of Tuxducks, I'm I'm willing to bet that Tux is going to keep working on his version. If Tux keeps working, he's going to keep commiting new changesets. So how do you get those new changesets?</p> <p>I'm glad you asked. The process is actually very simple. Just one word of advice: Make sure that your working copy is "clean". A "clean" working copy is one that hasn't changed at all since you originally performed the "baz get" command. If you can't remember whether or not you've changed your working copy since the last time you committed, then you can check for changes by running the following command:</p> <pre class="literal-block"> $ baz status </pre> <p>If you have changes, you'll see a list of files that have been modified, added, so forth and so on. So before you pull in Tux's new changes, you'll want to either commit your changes, do a "baz get" into a different dir and work with that one for the moment, or run the "baz undo" command. For the purposes of this tutorial, I'm going to assume that you don't have any changes.</p> <p>To actually merge in Tux's new changes, run the following command:</p> <pre class="literal-block"> $ baz update tux@penguin.org--2004/tuxducks--mainline--1 </pre> <p>Depending on how much Tux has worked, you may see only a couple changes, or you may see a lot of changes. If you want to see how how he changed his code, try out the nifty changes command with the diff option:</p> <pre class="literal-block"> $ baz diff | less </pre> <p>Now, there is only one thing left to do. Assuming that you are happy with the merge that happened, go ahead and commit your code:</p> <pre class="literal-block"> $ baz commit -s"Merged in Tux' latest changes" </pre> <p>And that's really all there is to it! Now you are able to branch off of anybody else's project, maintain your own changes to your branch of his project, and merge in new changes from the old project. You've done a pretty good job today. :)</p> </div> </body> </html>