Commits

David Schleimer committed 8feff33

layouts: make ui object available to layout instances

Comments (0)

Files changed (3)

hgsubversion/layouts/__init__.py

 }
 
 
-def layout_from_name(name):
+def layout_from_name(name, ui):
     """Returns a layout module given the layout name
 
     You should use one of the layout.detect.* functions to get the
 
     if name not in NAME_TO_CLASS:
         raise hgutil.Abort('Unknown hgsubversion layout: %s' %name)
-    return NAME_TO_CLASS[name]()
+    return NAME_TO_CLASS[name](ui)

hgsubversion/layouts/base.py

 
 class BaseLayout(object):
 
+    def __init__(self, ui):
+        self.ui = ui
+
     def __unimplemented(self, method_name):
         raise NotImplementedError(
             "Incomplete layout implementation: %s.%s doesn't implement %s" %

hgsubversion/svnmeta.py

     @property
     def layoutobj(self):
         if not self._layoutobj:
-            self._layoutobj = layouts.layout_from_name(self.layout)
+            self._layoutobj = layouts.layout_from_name(self.layout, self.ui)
         return self._layoutobj
 
     @property