[jhbuild] Support option "shallow_clone" in bazaar (as lightweight checkout)
- From: Craig Keogh <cskeogh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] Support option "shallow_clone" in bazaar (as lightweight checkout)
- Date: Thu, 20 Jun 2013 12:37:19 +0000 (UTC)
commit 6946b6a8c7ea1a3b3b023028863d9a40811f90e3
Author: Marcin Wojdyr <wojdyr gmail com>
Date: Thu May 16 18:13:22 2013 +0100
Support option "shallow_clone" in bazaar (as lightweight checkout)
jhbuild/defaults.jhbuildrc | 2 +-
jhbuild/versioncontrol/bzr.py | 17 +++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index c208ab6..e467a49 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -198,7 +198,7 @@ ignore_suggests = False
# local directory for DVCS mirror (git only atm)
dvcs_mirror_dir = None
-# If true, use --depth=1 to git
+# If true, use --depth=1 to git and bzr checkout --light
shallow_clone = False
# A string displayed before JHBuild executes a command. String may contain the
diff --git a/jhbuild/versioncontrol/bzr.py b/jhbuild/versioncontrol/bzr.py
index 9a43d3b..284e12a 100644
--- a/jhbuild/versioncontrol/bzr.py
+++ b/jhbuild/versioncontrol/bzr.py
@@ -185,7 +185,11 @@ Remove it or change your dvcs_mirror_dir settings.""") % self.srcdir)
self.create_mirror(buildscript)
self.real_update(buildscript)
else:
- cmd = ['bzr', 'branch'] + self.revspec + [self.module, self.srcdir]
+ if self.config.shallow_clone:
+ cmd = ['bzr', 'co', '--light']
+ else:
+ cmd = ['bzr', 'branch']
+ cmd += self.revspec + [self.module, self.srcdir]
buildscript.execute(cmd)
def _export(self, buildscript):
@@ -193,9 +197,14 @@ Remove it or change your dvcs_mirror_dir settings.""") % self.srcdir)
buildscript.execute(cmd)
def real_update(self, buildscript):
- cmd = ['bzr', 'pull'] + self.revspec + [self.module, '-d', self.srcdir]
- buildscript.execute(cmd)
- cmd = ['bzr', 'update'] + self.revspec + [self.srcdir]
+ # Do not assume that shallow_clone option was the same
+ # during checkout as now.
+ info = get_output(['bzr', 'info', self.srcdir], cwd=self.srcdir)
+ if info.startswith('Light'):
+ cmd = ['bzr', 'update'] + self.revspec
+ else:
+ cmd = ['bzr', 'pull'] + self.revspec + [self.module]
+ buildscript.execute(cmd, cwd=self.srcdir)
def _update(self, buildscript, copydir=None):
self.create_mirror(buildscript)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]