Mercurial > hg
changeset 30571: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 | c4c51fd0e11d |
children | cfb227016d01 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Dec 01 13:12:04 2016 +0530 +++ b/mercurial/localrepo.py Sun Dec 04 23:22:34 2016 +0530 @@ -249,7 +249,7 @@ # only functions defined in module of enabled extensions are invoked featuresetupfuncs = set() - def __init__(self, baseui, path=None, create=False): + def __init__(self, baseui, path, create=False): self.requirements = set() self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True) self.wopener = self.wvfs