]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa.utils.metadata: add commit count information
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 13 Jan 2017 13:12:42 +0000 (15:12 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 22:45:45 +0000 (22:45 +0000)
Makes it easier to put the commits into a timeline.

[YOCTO #10590]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/utils/metadata.py

index 2f7e8f2d0892cf143ef177c729162a560b70206e..d5cc2906b1a6cf18f4d8c24a235df95f16cf0ee5 100644 (file)
@@ -63,7 +63,7 @@ def metadata_from_data_store(d):
     pass
 
 def get_layers(layers):
-    """ Returns layer name, branch, and revision as OrderedDict. """
+    """Returns layer information in dict format"""
     from git import Repo, InvalidGitRepositoryError, NoSuchPathError
 
     layer_dict = OrderedDict()
@@ -75,6 +75,7 @@ def get_layers(layers):
         except (InvalidGitRepositoryError, NoSuchPathError):
             continue
         layer_dict[layer_name]['commit'] = repo.head.commit.hexsha
+        layer_dict[layer_name]['commit_count'] = repo.head.commit.count()
         try:
             layer_dict[layer_name]['branch'] = repo.active_branch.name
         except TypeError: