diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-11-27 22:25:30 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-04-10 09:17:50 +0900 |
commit | ede7f12d4a0f7362aaccd2c825a83765b9b9d968 (patch) | |
tree | e2b1683926292028a8e32ce32419228517d60d56 /manifest_xml.py | |
parent | 04d84a23fd04c9e1dd15341eb7dd28a0d8ce99c6 (diff) | |
download | git-repo-ede7f12d4a0f7362aaccd2c825a83765b9b9d968.tar.gz |
Allow clone depth to be specified per project
If the clone-depth attribute is set on a project, its value will
be used to set the depth when fetching the git. The value, if
given, must be a positive integer.
The value in the clone-depth attribute overrides any value given to
repo init via the --depth command line option.
Change-Id: I273015b3724213600b63e40cca4cafaa9f782ddf
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 92ef7859..4eef748f 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -665,6 +665,16 @@ class XmlManifest(object): | |||
665 | else: | 665 | else: |
666 | sync_s = sync_s.lower() in ("yes", "true", "1") | 666 | sync_s = sync_s.lower() in ("yes", "true", "1") |
667 | 667 | ||
668 | clone_depth = node.getAttribute('clone-depth') | ||
669 | if clone_depth: | ||
670 | try: | ||
671 | clone_depth = int(clone_depth) | ||
672 | if clone_depth <= 0: | ||
673 | raise ValueError() | ||
674 | except ValueError: | ||
675 | raise ManifestParseError('invalid clone-depth %s in %s' % | ||
676 | (clone_depth, self.manifestFile)) | ||
677 | |||
668 | upstream = node.getAttribute('upstream') | 678 | upstream = node.getAttribute('upstream') |
669 | 679 | ||
670 | groups = '' | 680 | groups = '' |
@@ -692,6 +702,7 @@ class XmlManifest(object): | |||
692 | groups = groups, | 702 | groups = groups, |
693 | sync_c = sync_c, | 703 | sync_c = sync_c, |
694 | sync_s = sync_s, | 704 | sync_s = sync_s, |
705 | clone_depth = clone_depth, | ||
695 | upstream = upstream, | 706 | upstream = upstream, |
696 | parent = parent) | 707 | parent = parent) |
697 | 708 | ||