@@ -104,7 +104,6 @@ def __init__(self, root_path):
104104 super (PureRootPathDB , self ).__init__ (root_path )
105105
106106
107-
108107 #{ Interface
109108 def root_path (self ):
110109 return self ._root_path
@@ -233,7 +232,7 @@ def partial_to_complete_sha(self, partial_binsha, hex_len):
233232
234233class PureRepositoryPathsMixin (RepositoryPathsMixin ):
235234 # slots has no effect here, its just to keep track of used attrs
236- __slots__ = ("_git_path" , '_bare' )
235+ __slots__ = ("_git_path" , '_bare' , '_working_tree_dir' )
237236
238237 #{ Configuration
239238 repo_dir = '.git'
@@ -272,14 +271,16 @@ def _initialize(self, path):
272271 raise InvalidGitRepositoryError (epath )
273272 # END path not found
274273
275- self ._bare = self ._git_path . endswith ( self . repo_dir )
274+ self ._bare = self ._working_tree_dir is None
276275 if hasattr (self , 'config_reader' ):
277276 try :
278277 self ._bare = self .config_reader ("repository" ).getboolean ('core' ,'bare' )
279278 except Exception :
280279 # lets not assume the option exists, although it should
281280 pass
281+ #END handle exception
282282 #END check bare flag
283+ self ._working_tree_dir = self ._bare and None or self ._working_tree_dir
283284
284285 #} end subclass interface
285286
@@ -313,7 +314,7 @@ def git_dir(self):
313314
314315 @property
315316 def working_tree_dir (self ):
316- if self .is_bare :
317+ if self ._working_tree_dir is None :
317318 raise AssertionError ("Repository at %s is bare and does not have a working tree directory" % self .git_dir )
318319 #END assertion
319320 return dirname (self .git_dir )
@@ -354,6 +355,10 @@ class PureConfigurationMixin(ConfigurationMixin):
354355 repo_config_file_name = "config"
355356 #} END
356357
358+ def __new__ (cls , * args , ** kwargs ):
359+ """This is just a stupid workaround for the evil py2.6 change which makes mixins quite impossible"""
360+ return super (PureConfigurationMixin , cls ).__new__ (cls , * args , ** kwargs )
361+
357362 def __init__ (self , * args , ** kwargs ):
358363 """Verify prereqs"""
359364 try :
@@ -421,7 +426,11 @@ class PureAlternatesFileMixin(object):
421426 #} END configuration
422427
423428 def __init__ (self , * args , ** kwargs ):
424- super (PureAlternatesFileMixin , self ).__init__ (* args , ** kwargs )
429+ try :
430+ super (PureAlternatesFileMixin , self ).__init__ (* args , ** kwargs )
431+ except TypeError :
432+ pass
433+ #END handle py2.6 code breaking changes
425434 self ._alternates_path () # throws on incompatible type
426435
427436 #{ Interface
0 commit comments