<!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>Shelving Changes — Bazaar v2.2.4 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.2.4', 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> <script type="text/javascript" src="../_static/translations.js"></script> <link rel="shortcut icon" href="../_static/bzr.ico"/> <link rel="top" title="Bazaar v2.2.4 documentation" href="../index.html" /> <link rel="up" title="Bazaarユーザーガイド" href="index.html" /> <link rel="next" title="Filtered views" href="filtered_views.html" /> <link rel="prev" title="疑似マージ" href="adv_merging.html" /> </head> <body> <div class="related"> <h3>ナビゲーション</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="filtered_views.html" title="Filtered views" accesskey="N">次へ</a></li> <li class="right" > <a href="adv_merging.html" title="疑似マージ" accesskey="P">前へ</a> |</li> <li><a href="../index.html">目次 (2.2.4)</a> »</li> <li><a href="index.html" accesskey="U">Bazaarユーザーガイド</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="shelving-changes"> <h1>Shelving Changes<a class="headerlink" href="#shelving-changes" title="このヘッドラインへのパーマリンク">¶</a></h1> <p>ときどき、作業ツリーから一時的に変更点を取り除いて、あとで元に戻したいことがあるかもしれません。 たとえば何か作業中に小さいバグフィックスを見つけてコミットする場合などです。 Bazaarは変更を <tt class="docutils literal"><span class="pre">shelf</span></tt> (書棚)に保存する機能を持っています。 後で変更を元に戻したくなったときは、 <tt class="docutils literal"><span class="pre">unshelve</span></tt> を使って作業ツリーに戻すことができます。</p> <p>たとえば、一つか複数の変更がされた作業ツリーを考えて見ます...:</p> <div class="highlight-python"><pre>$ bzr diff === modified file 'description.txt' --- description.txt +++ description.txt @@ -2,7 +2,7 @@ =============== These plugins -by Michael Ellerman +written by Michael Ellerman provide a very fine-grained 'undo' facility @@ -11,6 +11,6 @@ This allows you to undo some of your changes, -commit, and get +perform a commit, and get back to where you were before.</pre> </div> <p><tt class="docutils literal"><span class="pre">shelve</span></tt> コマンドはインタラクティブにどの変更を作業ツリーに保留しておきたいのかを質問します。:</p> <div class="highlight-python"><pre>$ bzr shelve --- description.txt +++ description.txt @@ -2,7 +2,7 @@ =============== These plugins -by Michael Ellerman +written by Michael Ellerman provide a very fine-grained 'undo' facility Shelve? [yNfrq?]: y --- description.txt +++ description.txt @@ -11,6 +11,6 @@ This allows you to undo some of your changes, -commit, and get +perform a commit, and get back to where you were before. Shelve? [yNfrq?]: n Shelve 2 change(s)? [yNfrq?]', 'y' Selected changes: M description.txt Changes shelved with id "1".</pre> </div> <p>もしたくさんの変更が作業ツリーにあるのであれば、 <tt class="docutils literal"><span class="pre">shelve</span></tt> コマンドにファイルのリストを渡して、それらのファイルの変更だけについて質問されるようにすることができます。 変更を shelve した後に <tt class="docutils literal"><span class="pre">diff</span></tt> コマンドで作業ツリーに期待する変更だけが残っていることを確認するとよいでしょう。:</p> <div class="highlight-python"><pre>$ bzr diff === modified file 'description.txt' --- description.txt +++ description.txt @@ -2,7 +2,7 @@ =============== These plugins -by Michael Ellerman +written by Michael Ellerman provide a very fine-grained 'undo' facility</pre> </div> <p>よし! - コミットする準備ができました:</p> <div class="highlight-python"><pre>$ bzr commit -m "improve first sentence"</pre> </div> <p>後になって、shelveした変更を作業ツリーに <tt class="docutils literal"><span class="pre">unshelve</span></tt> コマンドで戻します:</p> <div class="highlight-python"><pre>$ bzr unshelve Unshelving changes with id "1". M description.txt All changes applied successfully.</pre> </div> <p>もし望むのであれば、複数のアイテムをshelfに置くことができます。 通常 <tt class="docutils literal"><span class="pre">unshelve</span></tt> が実行されるたびに最も最近 shelve された変更が元に戻されます。 明示的にどの変更を戻すのかを指定することで別の順序で unshelve することもできます。</p> <p>Bazaarはshelveされた後に変更があっても、shelfの変更を作業ツリーにマージするので、衝突が発生するかもしれません。 その場合は通常のマージ後と同じように衝突を解決しなければなりません。</p> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h4>前のトピックへ</h4> <p class="topless"><a href="adv_merging.html" title="前の章へ">疑似マージ</a></p> <h4>次のトピックへ</h4> <p class="topless"><a href="filtered_views.html" title="次の章へ">Filtered views</a></p> <h3>このページ</h3> <ul class="this-page-menu"> <li><a href="../_sources/user-guide/shelving_changes.txt" rel="nofollow">ソースコードを表示</a></li> </ul> <div id="searchbox" style="display: none"> <h3>クイック検索</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="検索" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> モジュール、クラス、または関数名を入力してください </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>ナビゲーション</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="filtered_views.html" title="Filtered views" >次へ</a></li> <li class="right" > <a href="adv_merging.html" title="疑似マージ" >前へ</a> |</li> <li><a href="../index.html">目次 (2.2.4)</a> »</li> <li><a href="index.html" >Bazaarユーザーガイド</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009, Canonical Ltd. このドキュメントは <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7 で生成しました。 </div> </body> </html>