Rev 4733: Add direct tests that 'bzr switch' can handle root-id changes. in http://bazaar.launchpad.net/~jameinel/bzr/2.0.4-dirstate-set-root-504390

John Arbash Meinel john at arbash-meinel.com
Tue Jan 12 18:10:44 GMT 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.0.4-dirstate-set-root-504390

------------------------------------------------------------
revno: 4733
revision-id: john at arbash-meinel.com-20100112181023-ibfxk7usb6eqqp4i
parent: john at arbash-meinel.com-20100112180531-7iiom0p15574fqud
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.0.4-dirstate-set-root-504390
timestamp: Tue 2010-01-12 12:10:23 -0600
message:
  Add direct tests that 'bzr switch' can handle root-id changes.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_switch.py'
--- a/bzrlib/tests/test_switch.py	2009-05-07 05:08:46 +0000
+++ b/bzrlib/tests/test_switch.py	2010-01-12 18:10:23 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Canonical Ltd
+# Copyright (C) 2007-2010 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -100,6 +100,18 @@
         self.assertContainsRe(str(err),
             "Pending merges must be committed or reverted before using switch")
 
+    def test_switch_changing_root_id(self):
+        tree = self._setup_tree()
+        tree2 = self.make_branch_and_tree('tree-2')
+        tree2.set_root_id('custom-root-id')
+        self.build_tree(['tree-2/file-2'])
+        tree2.add(['file-2'])
+        tree2.commit('rev1b')
+        checkout = tree.branch.create_checkout('checkout',
+            lightweight=self.lightweight)
+        switch.switch(checkout.bzrdir, tree2.branch)
+        self.assertEqual('custom-root-id', tree2.get_root_id())
+
 
 class TestSwitchHeavyweight(TestSwitch):
 



More information about the bazaar-commits mailing list