Rev 92: Handle case where base branch is descendant of current branch. in file:///data/jelmer/bzr-rebase/trunk/

Jelmer Vernooij jelmer at samba.org
Wed Jun 11 18:35:51 BST 2008


At file:///data/jelmer/bzr-rebase/trunk/

------------------------------------------------------------
revno: 92
revision-id: jelmer at samba.org-20080611173550-km817617a7jo84y6
parent: jelmer at samba.org-20080529145715-h6l3hone8px6uo0h
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Wed 2008-06-11 19:35:50 +0200
message:
  Handle case where base branch is descendant of current branch.
modified:
  __init__.py                    __init__.py-20070626215909-fi0s39bkwxn4gcto-1
  test_blackbox.py               test_blackbox.py-20070709202607-dyvt95dfu09tuv6a-1
=== modified file '__init__.py'
--- a/__init__.py	2008-05-29 14:07:18 +0000
+++ b/__init__.py	2008-06-11 17:35:50 +0000
@@ -194,6 +194,9 @@
                 if common_revid == upstream.last_revision():
                     self.outf.write("No revisions to rebase.\n")
                     return
+                if common_revid == revhistory[-1]:
+                    self.outf.write("Base branch is descendant of current branch. Use 'bzr pull'.\n")
+                    return
                 try:
                     start_revid = revhistory[revhistory.index(common_revid)+1]
                 except NoSuchRevision:

=== modified file 'test_blackbox.py'
--- a/test_blackbox.py	2008-05-29 14:57:15 +0000
+++ b/test_blackbox.py	2008-06-11 17:35:50 +0000
@@ -42,6 +42,20 @@
         os.chdir('../feature')
         self.check_output('No revisions to rebase.\n', 'rebase ../main')
 
+    def test_notneeded_feature_ahead(self):
+        os.chdir('../feature')
+        self.make_file('barbla', "bloe")
+        self.run_bzr('add')
+        self.run_bzr('commit -m bloe')
+        self.check_output('No revisions to rebase.\n', 'rebase ../main')
+
+    def test_notneeded_main_ahead(self):
+        self.make_file('barbla', "bloe")
+        self.run_bzr('add')
+        self.run_bzr('commit -m bloe')
+        os.chdir('../feature')
+        self.check_output("Base branch is descendant of current branch. Use 'bzr pull'.\n", 'rebase ../main')
+
     def test_no_pending_merges(self):
         self.run_bzr_error(['bzr: ERROR: No pending merges present.\n'], 'rebase --pending-merges')
 




More information about the bazaar-commits mailing list