Rev 4443: (nmb) Add docs about diverged branches and refer to it when pushing in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Jun 15 18:06:53 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4443
revision-id: pqm at pqm.ubuntu.com-20090615170647-5zu6h93br8c4ue6i
parent: pqm at pqm.ubuntu.com-20090615154745-ma7p8rkmyegrzodf
parent: aaron at aaronbentley.com-20090615152024-w3crm2pxe7i9hdus
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2009-06-15 18:06:47 +0100
message:
  (nmb) Add docs about diverged branches and refer to it when pushing
  	fails
added:
  bzrlib/help_topics/en/diverged-branches.txt divergedbranches.txt-20090608035534-mb4ry8so4hw238n0-1
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
  bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
  bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
    ------------------------------------------------------------
    revno: 4441.1.1
    revision-id: aaron at aaronbentley.com-20090615152024-w3crm2pxe7i9hdus
    parent: pqm at pqm.ubuntu.com-20090615120359-3a9650kr76j1jyf2
    parent: nmb at wartburg.edu-20090608050001-7znk3433urf3bf0p
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.ab.integration
    timestamp: Mon 2009-06-15 11:20:24 -0400
    message:
      Merge nmb's diverged-branch docs.
    added:
      bzrlib/help_topics/en/diverged-branches.txt divergedbranches.txt-20090608035534-mb4ry8so4hw238n0-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
    ------------------------------------------------------------
    revno: 4416.4.1
    revision-id: nmb at wartburg.edu-20090608050001-7znk3433urf3bf0p
    parent: pqm at pqm.ubuntu.com-20090606005240-2qms4n1eqdshzp0w
    committer: Neil Martinsen-Burrell <nmb at wartburg.edu>
    branch nick: bzr.dev
    timestamp: Mon 2009-06-08 00:00:01 -0500
    message:
      Fix 269477 Add documentation about diverged branches and refer to it when pushing fails
    added:
      bzrlib/help_topics/en/diverged-branches.txt divergedbranches.txt-20090608035534-mb4ry8so4hw238n0-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
=== modified file 'NEWS'
--- a/NEWS	2009-06-15 08:20:38 +0000
+++ b/NEWS	2009-06-15 15:20:24 +0000
@@ -9,6 +9,14 @@
 In Development
 ##############
 
+Bug Fixes
+*********
+
+* Add documentation about diverged branches and how to fix them in the
+  centralized workflow with local commits.  Mention ``bzr help
+  diverged-branches`` when a push fails because the branches have
+  diverged.  (Neil Martinsen-Burrell, #269477)
+
 Internals
 *********
 
@@ -18,7 +26,6 @@
   rather than requiring all command names be known a-priori.
   (Robert Collins)
 
-
 bzr 1.16rc1 "It's yesterday in California" 2009-06-11
 #####################################################
 :Codename: yesterday-in-california

=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py	2009-06-11 06:54:33 +0000
+++ b/bzrlib/help_topics/__init__.py	2009-06-15 15:20:24 +0000
@@ -732,6 +732,8 @@
                         'Options to show or record debug information')
 topic_registry.register('log-formats', _load_from_file,
                         'Details on the logging formats available')
+topic_registry.register('diverged-branches', _load_from_file,
+                        'How to fix diverged branches')
 
 
 # Register concept topics.

=== added file 'bzrlib/help_topics/en/diverged-branches.txt'
--- a/bzrlib/help_topics/en/diverged-branches.txt	1970-01-01 00:00:00 +0000
+++ b/bzrlib/help_topics/en/diverged-branches.txt	2009-06-08 05:00:01 +0000
@@ -0,0 +1,39 @@
+Diverged Branches
+=================
+
+When Bazaar tries to push one branch onto another, it requires that the
+destination branch must be ready to receive the source branch.  If this isn't
+the case, then we say that the branches have ``diverged``.  Branches are
+considered diverged if the destination branch's most recent commit is one that
+has not been merged (directly or indirectly) by the source branch.  To recover
+from diverged branches, one must merge the missing revisions into the source
+branch.
+
+This situation commonly arises when using a centralized workflow with local
+commits.  If someone else has committed new work to the mainline since your
+last pull and you have local commits that have not yet been pushed to the
+mainline, then your local branch and the mainline have diverged.
+
+Discovering What Has Diverged
+-----------------------------
+
+The ``bzr missing`` command is used to find out what revisions are in another
+branch that are not present in the current branch, and vice-versa.  It shows a
+summary of  which extra revisions exist in each branch.  If you want to see the
+precise effects of those revisions, you can use ``bzr diff --old=other_branch``
+to show the differences between other_branch and your current branch.
+
+A Solution
+----------
+
+The solution is to merge the revisions from the mainline into your local
+branch.  To do so, use ``bzr merge`` to get the new revisions from the
+mainline.  This merge may result in conflicts if the other developer's changes
+overlap with your changes.  These conflicts should be resolved before
+continuing. After any conflicts have been resolved, or even if there were no
+conflicts, Bazaar requires that you explicitly commit these new revisions
+to your local branch.  This requirement gives you an opportunity to test the
+resulting working tree for correctness, since the merged revisions could have
+made arbitrary changes.  After testing, you should commit the merge using
+``bzr commit``.  This clears up the diverged branches situation.  Your local
+branch can now be pushed to the mainline.

=== modified file 'bzrlib/push.py'
--- a/bzrlib/push.py	2009-04-23 23:35:44 +0000
+++ b/bzrlib/push.py	2009-06-08 05:00:01 +0000
@@ -128,7 +128,8 @@
                 remember)
         except errors.DivergedBranches:
             raise errors.BzrCommandError('These branches have diverged.'
-                                    '  Try using "merge" and then "push".')
+                                    '  See "bzr help diverged-branches"'
+                                    ' for more information.')
         except errors.NoRepositoryPresent:
             # we have a bzrdir but no branch or repository
             # XXX: Figure out what to do other than complain.

=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py	2009-06-11 10:14:27 +0000
+++ b/bzrlib/tests/blackbox/test_push.py	2009-06-15 15:20:24 +0000
@@ -86,7 +86,7 @@
                            working_dir='branch_a', retcode=3)
         self.assertEquals(out,
                 ('','bzr: ERROR: These branches have diverged.  '
-                    'Try using "merge" and then "push".\n'))
+                 'See "bzr help diverged-branches" for more information.\n'))
         self.assertEquals(osutils.abspath(branch_a.get_push_location()),
                           osutils.abspath(branch_b.bzrdir.root_transport.base))
 




More information about the bazaar-commits mailing list