<!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>Revision Properties — Bazaar 2.7.0 documentation</title> <link rel="stylesheet" href="_static/classic.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.7.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="search" title="Search" href="search.html" /> <link rel="top" title="Bazaar 2.7.0 documentation" href="index.html" /> <link rel="up" title="Specifications" href="specifications.html" /> <link rel="next" title="API Versioning" href="api-versioning.html" /> <link rel="prev" title="Specifications" href="specifications.html" /> <link rel="stylesheet" href="_static/bzr-doc.css" type="text/css" /> </head> <body role="document"> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="api-versioning.html" title="API Versioning" accesskey="N">next</a></li> <li class="right" > <a href="specifications.html" title="Specifications" accesskey="P">previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li class="nav-item nav-item-0"><a href="index.html">Developer Document Catalog (2.7.0)</a> »</li> <li class="nav-item nav-item-1"><a href="specifications.html" accesskey="U">Specifications</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="revision-properties"> <h1>Revision Properties<a class="headerlink" href="#revision-properties" title="Permalink to this headline">¶</a></h1> <p>Bazaar repositories support setting of a key/value pairs for each revision. Applications can use these properties to store additional information about the revision.</p> <div class="section" id="usage"> <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2> <p>In general, revision properties are set by passing keyword argument <code class="docutils literal"><span class="pre">revprops</span></code> to method <code class="docutils literal"><span class="pre">MutableTree.commit</span></code>. For example:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">properties</span> <span class="o">=</span> <span class="p">{}</span> <span class="n">properties</span><span class="p">[</span><span class="s1">'my-property'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'test'</span> <span class="n">tree</span><span class="o">.</span><span class="n">commit</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">revprops</span><span class="o">=</span><span class="n">properties</span><span class="p">)</span> </pre></div> </div> <p>Properties can be retrieved via the attribute <code class="docutils literal"><span class="pre">properties</span></code> of instances of the class <code class="docutils literal"><span class="pre">Revision</span></code>:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="s1">'my-property'</span> <span class="ow">in</span> <span class="n">revision</span><span class="o">.</span><span class="n">properties</span><span class="p">:</span> <span class="n">my_property</span> <span class="o">=</span> <span class="n">revision</span><span class="o">.</span><span class="n">properties</span><span class="p">[</span><span class="s1">'my-property'</span><span class="p">]</span> <span class="o">...</span> </pre></div> </div> </div> <div class="section" id="well-known-properties"> <h2>Well-known properties<a class="headerlink" href="#well-known-properties" title="Permalink to this headline">¶</a></h2> <p>At the moment, three standardized revision properties are recognized and used by bzrlib:</p> <blockquote> <div><ul class="simple"> <li><code class="docutils literal"><span class="pre">authors</span></code> - Authors of the change. This value is a “\n” separated set of values in the same format as the committer-id. This property can be set by passing a list to the keyword argument <code class="docutils literal"><span class="pre">authors</span></code> of the function <code class="docutils literal"><span class="pre">MutableTree.commit</span></code>.</li> <li><code class="docutils literal"><span class="pre">author</span></code> - Single author of the change. This property is deprecated in favour of <code class="docutils literal"><span class="pre">authors</span></code>. It should no longer be set by any code, but will still be read. It is ignored if <code class="docutils literal"><span class="pre">authors</span></code> is set in the same revision.</li> <li><code class="docutils literal"><span class="pre">branch-nick</span></code> - Nickname of the branch. This can be specified by the user, but it defaults to the colocated branch name or the branch’s directory name. The value is set automatically in <code class="docutils literal"><span class="pre">MutableTree.commit</span></code>.</li> <li><code class="docutils literal"><span class="pre">bugs</span></code> - A list of bug URLs and their statuses. The list is separated by the new-line character (\n) and each entry is in format ‘<URL> <status>’. Currently, bzrlib uses only status ‘fixed’. See <a class="reference external" href="../en/user-guide/index.html#bug-trackers">Bug Trackers</a> for more details about using this feature.</li> </ul> </div></blockquote> </div> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Revision Properties</a><ul> <li><a class="reference internal" href="#usage">Usage</a></li> <li><a class="reference internal" href="#well-known-properties">Well-known properties</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="specifications.html" title="previous chapter">Specifications</a></p> <h4>Next topic</h4> <p class="topless"><a href="api-versioning.html" title="next chapter">API Versioning</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/revision-properties.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="api-versioning.html" title="API Versioning" >next</a></li> <li class="right" > <a href="specifications.html" title="Specifications" >previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li class="nav-item nav-item-0"><a href="index.html">Developer Document Catalog (2.7.0)</a> »</li> <li class="nav-item nav-item-1"><a href="specifications.html" >Specifications</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2009-2011 Canonical Ltd. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9. </div> </body> </html>