summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-29 16:46:21 -0700
committerChris Larson <chris_larson@mentor.com>2010-12-29 16:46:24 -0700
commit85e5a357ab5daaa293e567daee1b7c663cdc7f5c (patch)
tree5d70f8a3678c81b9235668503be32979344b04ad /lib/bb/fetch
parentd68a4e7ccf576cde38a9569e328341375bc8bc4e (diff)
downloadbitbake-85e5a357ab5daaa293e567daee1b7c663cdc7f5c.tar.gz
fetch: fix git rev key compat for sortable
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/fetch')
-rw-r--r--lib/bb/fetch/git.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/bb/fetch/git.py b/lib/bb/fetch/git.py
index 05be55ccf..77e6b6ce8 100644
--- a/lib/bb/fetch/git.py
+++ b/lib/bb/fetch/git.py
@@ -118,6 +118,7 @@ class Git(Fetch):
repofile = os.path.join(data.getVar("DL_DIR", d, 1), ud.mirrortarball)
+
coname = '%s' % (ud.tag)
codir = os.path.join(ud.clonedir, coname)
@@ -258,6 +259,49 @@ class Git(Fetch):
return str(rev)
+ def sortable_revision(self, url, ud, d):
+ """
+
+ """
+ pd = bb.persist_data.persist(d)
+ localcounts = pd['BB_URI_LOCALCOUNT']
+ key = self.generate_revision_key(url, ud, d, branch=True)
+ oldkey = self.generate_revision_key(url, ud, d, branch=False)
+
+ latest_rev = self._build_revision(url, ud, d)
+ last_rev = localcounts[key + '_rev']
+ if last_rev is None:
+ last_rev = localcounts[oldkey + '_rev']
+ if last_rev is not None:
+ del localcounts[oldkey + '_rev']
+ localcounts[key + '_rev'] = last_rev
+
+ uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
+ count = None
+ if uselocalcount:
+ count = Fetch.localcount_internal_helper(ud, d)
+ if count is None:
+ count = localcounts[key + '_count']
+ if count is None:
+ count = localcounts[oldkey + '_count']
+ if count is not None:
+ del localcounts[oldkey + '_count']
+ localcounts[key + '_count'] = count
+
+ if last_rev == latest_rev:
+ return str(count + "+" + latest_rev)
+
+ count = self._sortable_buildindex(url, ud, d, latest_rev)
+ if count is not None:
+ count = str(count)
+ else:
+ count = '0'
+
+ localcounts[key + '_rev'] = latest_rev
+ localcounts[key + '_count'] = count
+
+ return str(count + "+" + latest_rev)
+
def _build_revision(self, url, ud, d):
return ud.tag