diff options
author | Leif Middelschulte <leif.middelschulte@gmail.com> | 2017-09-26 13:56:58 +0200 |
---|---|---|
committer | Leif Middelschulte <leif.middelschulte@gmail.com> | 2017-09-26 13:56:58 +0200 |
commit | fab15d433a209a8487c98d82db1aa2fc4400c818 (patch) | |
tree | 10a25ad90e0f82031262a70f3dbce94f5f2da01a | |
parent | aa28675ebc1742f78b0ac61bda512035a7a5cb4c (diff) | |
download | meson-fab15d433a209a8487c98d82db1aa2fc4400c818.zip meson-fab15d433a209a8487c98d82db1aa2fc4400c818.tar.gz meson-fab15d433a209a8487c98d82db1aa2fc4400c818.tar.bz2 |
fixes offline working (if desired revision is already present).
-rw-r--r-- | mesonbuild/wrap/wrap.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index e7f9655..7cdf10e 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -237,16 +237,18 @@ class Resolver: revno = p.get('revision') is_there = os.path.isdir(checkoutdir) if is_there: + svn_info_output = subprocess.getoutput(' '.join(['svn', 'info', '--show-item', 'revision', checkoutdir])) + current_revno = int(svn_info_output) + if current_revno == revno: + return + if revno.lower() == 'head': # Failure to do pull is not a fatal error, # because otherwise you can't develop without # a working net connection. subprocess.call(['svn', 'update'], cwd=checkoutdir) else: - if subprocess.call(['svn', 'update', '-r', revno], cwd=checkoutdir) != 0: - subprocess.check_call(['svn', 'update'], cwd=checkoutdir) - subprocess.check_call(['svn', 'update', '-r', revno], - cwd=checkoutdir) + subprocess.check_call(['svn', 'update', '-r', revno], cwd=checkoutdir) else: subprocess.check_call(['svn', 'checkout', '-r', revno, p.get('url'), p.get('directory')], cwd=self.subdir_root) |