<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Glyphy</title>
  <link rel="alternate" type="text/html" href="http://glyphy.com/bzr-loom-2008-07-07"/>
  <link rel="self" type="application/atom+xml" href="http://glyphy.com/node/37/atom/feed"/>
  <id>http://glyphy.com/node/37/atom/feed</id>
  <updated>2008-07-07T20:16:29-07:00</updated>
  <entry>
    <title>bzr-loom</title>
    <link rel="alternate" type="text/html" href="http://glyphy.com/bzr-loom-2008-07-07" />
    <id>http://glyphy.com/bzr-loom-2008-07-07</id>
    <published>2008-07-07T20:16:29-07:00</published>
    <updated>2008-07-07T20:16:29-07:00</updated>
    <author>
      <name>dv</name>
    </author>
    <category term="bzr" />
    <summary type="html"><![CDATA[<p>Branching may be cheap in DVCSs from the technical perspective, but sometimes it&#8217;s other factors that make it a pain. For example, the environment setup procedure could be very tedious, or you may be unable to use hardlinks (Windows) and your branches are too large. The <a href="https://code.launchpad.net/bzr-loom">bzr-loom</a> plugin comes in handy in these situations. A very simple example follows:</p>

<div class="geshifilter"><pre class="bash geshifilter-bash"><span style="color: #666666; font-style: italic;">## Install bzr-loom using `bzr branch lp:bzr-loom` in your .bazaar/plugins/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a new repository</span>
$ bzr init bzr
$ <span style="color: #7a0874; font-weight: bold;">cd</span> bzr
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a new file</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> initial <span style="color: #000000; font-weight: bold;">&gt;</span> first
&nbsp;
<span style="color: #666666; font-style: italic;"># Check it in</span>
$ bzr add first
added first
$ bzr ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;initial&quot;</span>
Committing to: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>tro<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>
added first
Committed revision 1.
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> first
initial
&nbsp;
<span style="color: #666666; font-style: italic;"># Set the branch nick specifically. This is the initial development &quot;thread&quot;.</span>
$ bzr nick initial
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a loom. From this point on, you have to have the plugin to interact with this repo directly</span>
$ bzr loomify
&nbsp;
<span style="color: #666666; font-style: italic;"># Only one thread exists right now</span>
$ bzr show-loom
=<span style="color: #000000; font-weight: bold;">&gt;</span>initial
&nbsp;
<span style="color: #666666; font-style: italic;"># Add a new thread (acts as another branch inside the current directory)</span>
$ bzr create-thread feature-<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Add a new file</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;second file&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> second
$ bzr add second
added second
$ bzr ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;+second&quot;</span>
Committing to: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>tro<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>
added second
Committed revision 2.
&nbsp;
<span style="color: #666666; font-style: italic;"># Switch back to the initial dev thread. Note how &quot;second&quot; disappears, since it is in another thread.</span>
$ bzr down-thread
All changes applied successfully.
Moved to thread <span style="color: #ff0000;">'initial'</span>.
$ bzr show-loom
  feature-<span style="color: #000000;">1</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span>initial
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first
&nbsp;
<span style="color: #666666; font-style: italic;"># Switch to feature-1</span>
$ bzr up-thread <span style="color: #666666; font-style: italic;"># this would do a merge, if any new changes were made in &quot;initial&quot;</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first  second
&nbsp;
<span style="color: #666666; font-style: italic;"># Edit first</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;edit in feature-1 thread&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> first
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> first
initial
edit <span style="color: #000000; font-weight: bold;">in</span> feature-<span style="color: #000000;">1</span> thread
$ bzr ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;useless text meant to illustrate merging between threads&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># At this point pretend that we are satisfied with the changes in &quot;feature-1&quot;</span>
<span style="color: #666666; font-style: italic;"># and want to merge them into &quot;initial&quot;. Go there.</span>
$ bzr down-thread
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first
$ bzr merge <span style="color: #660033;">-r</span> thread:feature-<span style="color: #000000;">1</span> .
+N  second
 M  first
All changes applied successfully.
&nbsp;
<span style="color: #666666; font-style: italic;"># Merged changes from feature-1 to initial</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first  second
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> first
initial
edit <span style="color: #000000; font-weight: bold;">in</span> feature-<span style="color: #000000;">1</span> thread
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> second
second <span style="color: #c20cb9; font-weight: bold;">file</span></pre></div>

<p>This gives you a limited git-like ability to spawn off new branches in the current directory.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>Branching may be cheap in DVCSs from the technical perspective, but sometimes it&#8217;s other factors that make it a pain. For example, the environment setup procedure could be very tedious, or you may be unable to use hardlinks (Windows) and your branches are too large. The <a href="https://code.launchpad.net/bzr-loom">bzr-loom</a> plugin comes in handy in these situations. A very simple example follows:</p>

<div class="geshifilter"><pre class="bash geshifilter-bash"><span style="color: #666666; font-style: italic;">## Install bzr-loom using `bzr branch lp:bzr-loom` in your .bazaar/plugins/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a new repository</span>
$ bzr init bzr
$ <span style="color: #7a0874; font-weight: bold;">cd</span> bzr
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a new file</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> initial <span style="color: #000000; font-weight: bold;">&gt;</span> first
&nbsp;
<span style="color: #666666; font-style: italic;"># Check it in</span>
$ bzr add first
added first
$ bzr ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;initial&quot;</span>
Committing to: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>tro<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>
added first
Committed revision 1.
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> first
initial
&nbsp;
<span style="color: #666666; font-style: italic;"># Set the branch nick specifically. This is the initial development &quot;thread&quot;.</span>
$ bzr nick initial
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a loom. From this point on, you have to have the plugin to interact with this repo directly</span>
$ bzr loomify
&nbsp;
<span style="color: #666666; font-style: italic;"># Only one thread exists right now</span>
$ bzr show-loom
=<span style="color: #000000; font-weight: bold;">&gt;</span>initial
&nbsp;
<span style="color: #666666; font-style: italic;"># Add a new thread (acts as another branch inside the current directory)</span>
$ bzr create-thread feature-<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Add a new file</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;second file&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> second
$ bzr add second
added second
$ bzr ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;+second&quot;</span>
Committing to: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>tro<span style="color: #000000; font-weight: bold;">/</span>temp<span style="color: #000000; font-weight: bold;">/</span>bzr<span style="color: #000000; font-weight: bold;">/</span>
added second
Committed revision 2.
&nbsp;
<span style="color: #666666; font-style: italic;"># Switch back to the initial dev thread. Note how &quot;second&quot; disappears, since it is in another thread.</span>
$ bzr down-thread
All changes applied successfully.
Moved to thread <span style="color: #ff0000;">'initial'</span>.
$ bzr show-loom
  feature-<span style="color: #000000;">1</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span>initial
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first
&nbsp;
<span style="color: #666666; font-style: italic;"># Switch to feature-1</span>
$ bzr up-thread <span style="color: #666666; font-style: italic;"># this would do a merge, if any new changes were made in &quot;initial&quot;</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first  second
&nbsp;
<span style="color: #666666; font-style: italic;"># Edit first</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;edit in feature-1 thread&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> first
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> first
initial
edit <span style="color: #000000; font-weight: bold;">in</span> feature-<span style="color: #000000;">1</span> thread
$ bzr ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;useless text meant to illustrate merging between threads&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># At this point pretend that we are satisfied with the changes in &quot;feature-1&quot;</span>
<span style="color: #666666; font-style: italic;"># and want to merge them into &quot;initial&quot;. Go there.</span>
$ bzr down-thread
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first
$ bzr merge <span style="color: #660033;">-r</span> thread:feature-<span style="color: #000000;">1</span> .
+N  second
 M  first
All changes applied successfully.
&nbsp;
<span style="color: #666666; font-style: italic;"># Merged changes from feature-1 to initial</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
first  second
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> first
initial
edit <span style="color: #000000; font-weight: bold;">in</span> feature-<span style="color: #000000;">1</span> thread
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> second
second <span style="color: #c20cb9; font-weight: bold;">file</span></pre></div>

<p>This gives you a limited git-like ability to spawn off new branches in the current directory.</p>
    ]]></content>
  </entry>
</feed>
