List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:June 24 2008 1:26pm
Subject:bzr commit into mysql_plugins branch (joerg:124)
View as plain text  
#At file:///home/joerg/.bazaar/plugins/mysql_plugins/

  124 Joerg Bruehe	2008-06-24 [merge]
      Merge from central repository.
modified:
  __init__.py
  directory.py
  parent.py

=== modified file '__init__.py'
--- a/__init__.py	2008-06-18 16:57:10 +0000
+++ b/__init__.py	2008-06-24 13:25:43 +0000
@@ -41,10 +41,10 @@ register_command(parent.cmd_parent)
 register_command(collapse.cmd_collapse)
 register_command(unmerged.cmd_unmerged)
 try:
-  import importmbox
-  register_command(importmbox.cmd_importmbox)
+    import importmbox
+    register_command(importmbox.cmd_importmbox)
 except ImportError:
-  mutter("importmbox not available unless bzrtools is installed")
+    mutter("importmbox not available unless bzrtools is installed")
 
 
 try:
@@ -80,3 +80,7 @@ try:
     install_hook_named_or_not("pre_commit", sanity.pre_commit_hook, "pre_commit hook that does sanity checks")
 except:
     mutter("bzr-mysql: Can't install pre_commit_hook")
+
+
+# vim: sta
+# vi: et sw=4 ts=4

=== modified file 'directory.py'
--- a/directory.py	2008-05-22 20:38:37 +0000
+++ b/directory.py	2008-05-30 21:43:58 +0000
@@ -32,3 +32,7 @@ class MysqlDirectory(object):
         assert "/" not in auth
         assert branchpath.startswith("/")
         return "bzr+ssh://%(auth)sbk-internal.mysql.com/bzrroot%(branchpath)s" % locals()
+
+
+# vim: sta
+# vi: et sw=4 ts=4

=== modified file 'parent.py'
--- a/parent.py	2008-04-24 22:13:25 +0000
+++ b/parent.py	2008-05-30 21:43:58 +0000
@@ -1,4 +1,3 @@
-# vim: set fileencoding=utf8 noexpandtab tabstop=4 shiftwidth=4 :
 #    parent.py -- set or view the parent repository of a branch
 #    Copyright (C) 2007 MySQL Inc.
 #    
@@ -22,6 +21,7 @@
 """
 # Chad Miller, 2007-01-04, MySQL AB.  GPL
 
+from bzrlib.trace import warning
 from bzrlib.commands import Command, register_command, display_command
 
 from bzrlib.lazy_import import lazy_import
@@ -29,17 +29,33 @@ lazy_import(globals(), """
 from bzrlib.branch import Branch
 """)
 
+
+
+try:
+    from bzrlib.directory_service import directories
+except ImportError:
+    class FakeDirectoryService():
+        def dereference(self, url):
+            warning("Bzr is too old.  You may get a wrong answer.")
+            return url
+    directories = FakeDirectoryService()
+
 class cmd_parent(Command):
-        """View or set the parent and push location.
-        
-        This does not attempt to verify that the location is correct or sound."""
-        takes_args = ( "new_location?", )
-
-        def run(self, new_location=None):
-                current_tree = Branch.open_containing(".")[0]
-                if new_location is None:
-                        print current_tree.get_parent()
-                else:
-                        current_tree.set_parent(new_location)
-                        current_tree.set_push_location(new_location)
+    """View or set the parent and push location.
+    
+    This does not attempt to verify that the location is correct or sound."""
+    takes_args = ( "new_location?", )
+
+    def run(self, new_location=None):
+        current_tree = Branch.open_containing(".")[0]
+        if new_location is None:
+            print current_tree.get_parent()
+        else:
+            assert isinstance(new_location, basestring)
+            mapped_location = directories.dereference(new_location)
+            current_tree.set_parent(mapped_location)
+            current_tree.set_push_location(mapped_location)
+
 
+# vim: sta fileencoding=utf8
+# vi: et sw=4 ts=4

Thread
bzr commit into mysql_plugins branch (joerg:124) Joerg Bruehe24 Jun