Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 27647990744ebd9cfe32398f37f67e20 > files > 3052

bzr-2.6.0-11.1.mga5.i586.rpm

<!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">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Using checkouts &mdash; Bazaar 2.6.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.6.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/bzr.ico"/>
    <link rel="top" title="Bazaar 2.6.0 documentation" href="../index.html" />
    <link rel="up" title="Bazaar User Guide" href="index.html" />
    <link rel="next" title="Working offline on a central branch" href="working_offline_central.html" />
    <link rel="prev" title="Publishing a branch" href="publishing_a_branch.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="working_offline_central.html" title="Working offline on a central branch"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="publishing_a_branch.html" title="Publishing a branch"
             accesskey="P">previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.6.0)</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">Bazaar User Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="using-checkouts">
<h1>Using checkouts<a class="headerlink" href="#using-checkouts" title="Permalink to this headline">¶</a></h1>
<div class="section" id="turning-a-branch-into-a-checkout">
<h2>Turning a branch into a checkout<a class="headerlink" href="#turning-a-branch-into-a-checkout" title="Permalink to this headline">¶</a></h2>
<p>If you have a local branch and wish to make it a checkout, use the
<tt class="docutils literal"><span class="pre">bind</span></tt> command like this:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr bind bzr+ssh://centralhost/srv/bzr/PROJECT/trunk
</pre></div>
</div>
<p>This is necessary, for example, after creating a central branch using
<tt class="docutils literal"><span class="pre">push</span></tt> as illustrated in the previous section.</p>
<p>After this, commits will be applied to the bound branch before
being applied locally.</p>
</div>
<div class="section" id="turning-a-checkout-into-a-branch">
<h2>Turning a checkout into a branch<a class="headerlink" href="#turning-a-checkout-into-a-branch" title="Permalink to this headline">¶</a></h2>
<p>If you have a checkout and wish to make it a normal branch, use the
<tt class="docutils literal"><span class="pre">unbind</span></tt> command like this:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr unbind
</pre></div>
</div>
<p>After this, commits will only be applied locally.</p>
</div>
<div class="section" id="getting-a-checkout">
<h2>Getting a checkout<a class="headerlink" href="#getting-a-checkout" title="Permalink to this headline">¶</a></h2>
<p>When working in a team using a central branch, one person needs
to provide some initial content as shown in the previous section.
After that, each person should use the <tt class="docutils literal"><span class="pre">checkout</span></tt> command to
create their local checkout, i.e. the sandbox in which they
will make their changes.</p>
<p>Unlike Subversion and CVS, in Bazaar the <tt class="docutils literal"><span class="pre">checkout</span></tt> command creates a
local full copy of history in addition to creating a working tree holding
the latest content. This means that operations such as <tt class="docutils literal"><span class="pre">diff</span></tt> and <tt class="docutils literal"><span class="pre">log</span></tt>
are fast and can still be used when disconnected from the central location.</p>
</div>
<div class="section" id="getting-a-lightweight-checkout">
<h2>Getting a lightweight checkout<a class="headerlink" href="#getting-a-lightweight-checkout" title="Permalink to this headline">¶</a></h2>
<p>While Bazaar does its best to efficiently store version history, there
are occasions when the history is simply not wanted. For example, if your
team is managing the content of a web site using Bazaar with a
central repository, then your release process might be as simple as
updating a checkout of the content on the public web server. In this
case, you probably don&#8217;t want the history downloaded to that location
as doing so:</p>
<blockquote>
<div><ul class="simple">
<li>wastes disk space holding history that isn&#8217;t needed there</li>
<li>exposes a Bazaar branch that you may want kept private.</li>
</ul>
</div></blockquote>
<p>To get a history-less checkout in Bazaar, use the <tt class="docutils literal"><span class="pre">--lightweight</span></tt>
option like this:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr checkout --lightweight bzr+ssh://centralhost/srv/bzr/PROJECT/trunk
</pre></div>
</div>
<p>Of course, many of the benefits of a normal checkout are lost by doing
this but that&#8217;s a tradeoff you can make if and when it makes sense.</p>
<p>The <tt class="docutils literal"><span class="pre">--lightweight</span></tt> option only applies to checkouts, not to all branches.</p>
<p>Note: If your code base is really large and disk space on your computer
is limited, lightweight checkouts may be the right choice for you.
Be sure to consider all your options though including
<a class="reference external" href="branching_a_project.html#a-reminder-about-shared-repositories">shared repositories</a>,
<a class="reference external" href="stacked.html">stacked branches</a>, and
<a class="reference external" href="reusing_a_checkout.html">reusing a checkout</a>.</p>
</div>
<div class="section" id="updating-to-the-latest-content">
<h2>Updating to the latest content<a class="headerlink" href="#updating-to-the-latest-content" title="Permalink to this headline">¶</a></h2>
<p>One of the important aspects of working in lockstep with others is
keeping your checkout up to date with the latest changes made to
the central branch. Just as you would in Subversion or CVS, you do
this in Bazaar by using the <tt class="docutils literal"><span class="pre">update</span></tt> command like this:</p>
<div class="highlight-python"><div class="highlight"><pre>bzr update
</pre></div>
</div>
<p>This gets any new revisions available in the bound branch and
merges your local changes, if any.</p>
</div>
<div class="section" id="handling-commit-failures">
<h2>Handling commit failures<a class="headerlink" href="#handling-commit-failures" title="Permalink to this headline">¶</a></h2>
<p>Note that your checkout <em>must</em> be up to date with the bound branch
before running <tt class="docutils literal"><span class="pre">commit</span></tt>. Bazaar is actually stricter about this
than Subversion or CVS - you need to be up to date with the full
tree, not just for the files you&#8217;ve changed. Bazaar will ask you
to run <tt class="docutils literal"><span class="pre">update</span></tt> if it detects that a revision has been added to
the central location since you last updated.</p>
<p>If the network connection to the bound branch is lost, the commit will
fail. Some alternative ways of working around that are outlined next.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Using checkouts</a><ul>
<li><a class="reference internal" href="#turning-a-branch-into-a-checkout">Turning a branch into a checkout</a></li>
<li><a class="reference internal" href="#turning-a-checkout-into-a-branch">Turning a checkout into a branch</a></li>
<li><a class="reference internal" href="#getting-a-checkout">Getting a checkout</a></li>
<li><a class="reference internal" href="#getting-a-lightweight-checkout">Getting a lightweight checkout</a></li>
<li><a class="reference internal" href="#updating-to-the-latest-content">Updating to the latest content</a></li>
<li><a class="reference internal" href="#handling-commit-failures">Handling commit failures</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="publishing_a_branch.html"
                        title="previous chapter">Publishing a branch</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="working_offline_central.html"
                        title="next chapter">Working offline on a central branch</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/user-guide/using_checkouts.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="working_offline_central.html" title="Working offline on a central branch"
             >next</a></li>
        <li class="right" >
          <a href="publishing_a_branch.html" title="Publishing a branch"
             >previous</a> |</li>
<li><a href="http://bazaar.canonical.com/">
    <img src="../_static/bzr icon 16.png" /> Home</a>&nbsp;|&nbsp;</li>
<a href="http://doc.bazaar.canonical.com/en/">Documentation</a>&nbsp;|&nbsp;</li>

        <li><a href="../index.html">Table of Contents (2.6.0)</a> &raquo;</li>

          <li><a href="index.html" >Bazaar User Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2011 Canonical Ltd.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>