diff options
author | Mohammed Amer Khalidi <mohammedamer.khalidi@cirrus.com> | 2018-07-26 15:28:32 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-07 18:55:46 +0300 |
commit | 376cdd7054a112f76cd0efcf32287b8efbbaf9ec (patch) | |
tree | 8e8bdd1e9ea6490e731259a0878055cbc1a3ee38 | |
parent | c0c2455e3c2536f18ada80a0f738659508f012c1 (diff) | |
download | meson-376cdd7054a112f76cd0efcf32287b8efbbaf9ec.zip meson-376cdd7054a112f76cd0efcf32287b8efbbaf9ec.tar.gz meson-376cdd7054a112f76cd0efcf32287b8efbbaf9ec.tar.bz2 |
Adding support to checkout from reviews in git/gerrit using commit ids.
-rw-r--r-- | mesonbuild/wrap/wrap.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 54a928e..a3f8ab1 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -203,15 +203,17 @@ class Resolver: subprocess.call(['git', 'pull'], cwd=checkoutdir) else: if subprocess.call(['git', 'checkout', revno], cwd=checkoutdir) != 0: - subprocess.check_call(['git', 'fetch'], cwd=checkoutdir) + subprocess.check_call(['git', 'fetch', p.get('url'), revno], cwd=checkoutdir) subprocess.check_call(['git', 'checkout', revno], cwd=checkoutdir) else: subprocess.check_call(['git', 'clone', p.get('url'), p.get('directory')], cwd=self.subdir_root) if revno.lower() != 'head': - subprocess.check_call(['git', 'checkout', revno], - cwd=checkoutdir) + if subprocess.call(['git', 'checkout', revno], cwd=checkoutdir) != 0: + subprocess.check_call(['git', 'fetch', p.get('url'), revno], cwd=checkoutdir) + subprocess.check_call(['git', 'checkout', revno], + cwd=checkoutdir) push_url = p.values.get('push-url') if push_url: subprocess.check_call(['git', 'remote', 'set-url', |