[Python-checkins] devguide (hg_transition): Add FAQ entries for simple navigation between branches

antoine.pitrou python-checkins at python.org
Fri Feb 25 17:57:51 CET 2011


antoine.pitrou pushed f28fc95f0233 to devguide:

http://hg.python.org/devguide/rev/f28fc95f0233
changeset:   315:f28fc95f0233
branch:      hg_transition
tag:         tip
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Fri Feb 25 17:57:48 2011 +0100
summary:
  Add FAQ entries for simple navigation between branches

files:
  faq.rst

diff --git a/faq.rst b/faq.rst
--- a/faq.rst
+++ b/faq.rst
@@ -98,6 +98,76 @@
 so are ``hg pull`` and ``hg push``.
 
 
+Which branches are in my local repository?
+------------------------------------------
+
+Typing ``hg branches`` displays the open branches in your local repository::
+
+   $ hg branches
+   default                    68026:f12ef116dd10
+   3.2                        68025:cef92ee1a323
+   2.7                        68010:8174d00d0797
+   3.1                        67955:5be8b695ea86
+   2.6                        67287:5e26a860eded
+   2.5                        65464:e4ecac76e499
+   trunk                      62750:800f6c92c3ed
+   3.0                        60075:1d05144224fe
+   2.4                        58552:df72cac1899e
+   2.3                        45731:a3d9a9730743
+   2.2                        40444:d55ddc8c8501
+   2.1                        30171:06fcccf6eca8
+   2.0                        18214:dc0dfc9565cd
+
+
+Which branch is currently checked out in my working copy?
+---------------------------------------------------------
+
+Use::
+
+   $ hg branch
+   default
+
+Or to get more information::
+
+   $ hg summary
+   parent: 68026:f12ef116dd10 tip
+    In FTP.close() method, make sure to also close the socket object, not only the file.
+   branch: default
+   commit: (clean)
+   update: (current)
+
+
+How do I switch between branches inside my working copy?
+--------------------------------------------------------
+
+Simply use ``hg update`` to checkout another branch in the current directory::
+
+   $ hg branch
+   default
+   $ hg update 3.2
+   86 files updated, 0 files merged, 11 files removed, 0 files unresolved
+   $ hg branch
+   3.2
+
+Adding the ``-v`` option to ``hg update`` will list all updated files.
+
+
+I want to keep a separate working copy per development branch, is it possible?
+------------------------------------------------------------------------------
+
+Just clone your local repository and update each clone to a different branch::
+
+   $ hg clone cpython py32
+   updating to branch default
+   3434 files updated, 0 files merged, 0 files removed, 0 files unresolved
+   $ cd py32
+   $ hg update 3.2
+   86 files updated, 0 files merged, 11 files removed, 0 files unresolved
+
+The current branch in a working copy is "sticky": if you pull in some new
+changes, ``hg update`` will update to the head of the *current branch*.
+
+
 How do I link my local repository to a particular remote repository?
 -------------------------------------------------------------------------------
 

--
Repository URL: http://hg.python.org/devguide


More information about the Python-checkins mailing list