diff options
author | Alexandre Foley <Alexandre.foley@usherbrooke.ca> | 2016-12-06 09:45:20 -0500 |
---|---|---|
committer | Alexandre Foley <Alexandre.foley@usherbrooke.ca> | 2016-12-06 09:45:20 -0500 |
commit | 61d5934e63af65536cd22ef16127b4920c21c4f3 (patch) | |
tree | b7cad0f88067d67dce1d12e1a4003427af286779 | |
parent | 228adaa287517015a5ec86d36fbd60b4bb031a31 (diff) | |
download | meson-61d5934e63af65536cd22ef16127b4920c21c4f3.zip meson-61d5934e63af65536cd22ef16127b4920c21c4f3.tar.gz meson-61d5934e63af65536cd22ef16127b4920c21c4f3.tar.bz2 |
Added a few missing whitespace as noted by Ignatenkobrain. Replaced a comment by the piece of code it said was needed.
-rw-r--r-- | mesonbuild/wrap/wrap.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 1ebff3c..57c7353 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -99,7 +99,7 @@ class Resolver: ' ensure clean download' % dirname) os.rmdir(dirname) except NotADirectoryError: - raise RuntimeError('%s is not a directory, can not use as subproject.' % dirname) + raise RuntimeError('%s is not a directory, can not use as subproject.' %dirname) except FileNotFoundError: pass @@ -111,7 +111,7 @@ class Resolver: if os.path.isdir(dirname): # project already there? great, use it! # only for the file case because otherwise we prevent git - # and hg from updating the subproject. or doing that fancy git push feature that doesn't belong + # and hg from updating the subproject. return packagename if not os.path.isdir(self.cachedir): os.mkdir(self.cachedir) @@ -164,15 +164,16 @@ class Resolver: revno = p.get('revision') is_there = os.path.isdir(checkoutdir) if is_there: - #Need to add a check that the directory is a valid HG repo + if not os.path.isdir(os.path.join(checkoutdir, '.hg')): + raise RuntimeError('Subproject %s is not a valid mercurial repo.'%p.get('directory')) if revno.lower() == 'tip': # Failure to do pull is not a fatal error, # because otherwise you can't develop without # a working net connection. subprocess.call(['hg', 'pull'], cwd=checkoutdir) - subprocess.call(['hg','update','tip'],cwd = checkoutdir) + subprocess.call(['hg', 'update', 'tip'],cwd = checkoutdir) else: - #check that the tag/branch/revision we want is available in the + # check that the tag/branch/revision we want is available in the # repo, if not, pull and update. if subprocess.call(['hg', 'checkout', revno], cwd=checkoutdir) != 0: subprocess.check_call(['hg', 'pull'], cwd=checkoutdir) |