Rev 3: Switch to using the 'submit_branch' as the default source. in http://bzr.arbash-meinel.com/plugins/start

John Arbash Meinel john at arbash-meinel.com
Wed Jan 21 17:53:57 GMT 2009


At http://bzr.arbash-meinel.com/plugins/start

------------------------------------------------------------
revno: 3
revision-id: john at arbash-meinel.com-20090121175350-vulro7idq2fhp07p
parent: john at arbash-meinel.com-20090121174556-pj9gfcf0a064lghc
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: start
timestamp: Wed 2009-01-21 11:53:50 -0600
message:
  Switch to using the 'submit_branch' as the default source.
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2009-01-21 17:45:56 +0000
+++ b/__init__.py	2009-01-21 17:53:50 +0000
@@ -42,20 +42,23 @@
             config,
             osutils,
             switch,
+            trace,
             workingtree,
             )
         wt, _ = workingtree.WorkingTree.open_containing('.')
         c = config.LocationConfig(wt.basedir)
-        trunk_branch = c.get_user_option('trunk_branch')
-        if trunk_branch is None:
-            raise errors.BzrCommandError('No "trunk_branch" configured')
-        b = branch.Branch.open(trunk_branch)
+        submit_branch = c.get_user_option('submit_branch')
+        if submit_branch is None:
+            raise errors.BzrCommandError('No "submit_branch" configured')
+        b = branch.Branch.open(submit_branch)
         if revision is not None:
             revision_id = revision[0].as_revision_id(b)
         else:
             revision_id = None
         new_b = b.bzrdir.sprout(location, revision_id=revision_id).open_branch()
         switch.switch(wt.bzrdir, new_b)
+        trace.note('Created and switched to branch at %s', location)
+
 commands.register_command(cmd_start)
 
 

=== modified file 'test_start.py'
--- a/test_start.py	2009-01-21 17:45:56 +0000
+++ b/test_start.py	2009-01-21 17:53:50 +0000
@@ -35,11 +35,11 @@
         builder.build_snapshot('rev2', ['rev1'], [])
         b = builder.get_branch()
         c = config.LocationConfig(osutils.getcwd())
-        c.set_user_option('trunk_branch', b.base)
+        c.set_user_option('submit_branch', b.base)
         b.create_checkout('tree', lightweight=True)
 
-    def test_no_trunk_branch(self):
-        self.run_bzr_error(['No "trunk_branch" configured'],
+    def test_no_submit_branch(self):
+        self.run_bzr_error(['No "submit_branch" configured'],
             'start foobar')
 
     def test_create_new_branch(self):
@@ -63,3 +63,4 @@
         # And that the local tree is pointing at it
         tree = workingtree.WorkingTree.open('tree')
         self.assertEqual(b.base, tree.branch.base)
+        self.assertEqual('rev1', tree.last_revision())



More information about the bazaar-commits mailing list