Mercurial > hg-stable
comparison mercurial/localrepo.py @ 30576:91db2aa0edfe
localrepository: remove None as default value of path argument in __init__()
The path variable in localrepository.__init__() has a default value None. So
it gives us a option to create an object to localrespository class without
path variable. But things break if you try to do so. The second line in the
init which will be executed when we try to create a localrepository object
will call os.path.expandvars(path) which returns
TypeError: argument of type 'NoneType' is not iterable
I checked occurrences when it is called and can't find any piece of code
which calls it without path variable. Also if something is calling it, its
should break.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 04 Dec 2016 23:22:34 +0530 |
parents | 46d2c8b23c33 |
children | f8c9a7d2bbbf |
comparison
equal
deleted
inserted
replaced
30575:c4c51fd0e11d | 30576:91db2aa0edfe |
---|---|
247 | 247 |
248 # a list of (ui, featureset) functions. | 248 # a list of (ui, featureset) functions. |
249 # only functions defined in module of enabled extensions are invoked | 249 # only functions defined in module of enabled extensions are invoked |
250 featuresetupfuncs = set() | 250 featuresetupfuncs = set() |
251 | 251 |
252 def __init__(self, baseui, path=None, create=False): | 252 def __init__(self, baseui, path, create=False): |
253 self.requirements = set() | 253 self.requirements = set() |
254 self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True) | 254 self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True) |
255 self.wopener = self.wvfs | 255 self.wopener = self.wvfs |
256 self.root = self.wvfs.base | 256 self.root = self.wvfs.base |
257 self.path = self.wvfs.join(".hg") | 257 self.path = self.wvfs.join(".hg") |