mercurial/bundlerepo.py
changeset 2740 386f04d6ecb3
parent 2673 109a22f5434a
child 3429 b19360aa21e9
equal deleted inserted replaced
2739:3248aa10b388 2740:386f04d6ecb3
   235     def __del__(self):
   235     def __del__(self):
   236         if not self.bundlefile.closed:
   236         if not self.bundlefile.closed:
   237             self.bundlefile.close()
   237             self.bundlefile.close()
   238         if self.tempfile is not None:
   238         if self.tempfile is not None:
   239             os.unlink(self.tempfile)
   239             os.unlink(self.tempfile)
       
   240 
       
   241 def instance(ui, path, create):
       
   242     if create:
       
   243         raise util.Abort(_('cannot create new bundle repository'))
       
   244     path = util.drop_scheme('file', path)
       
   245     if path.startswith('bundle:'):
       
   246         path = util.drop_scheme('bundle', path)
       
   247         s = path.split("+", 1)
       
   248         if len(s) == 1:
       
   249             repopath, bundlename = "", s[0]
       
   250         else:
       
   251             repopath, bundlename = s
       
   252     else:
       
   253         repopath, bundlename = '', path
       
   254     return bundlerepository(ui, repopath, bundlename)