Patchwork [bitbake-devel] hob/builddetailspage: change branch field

login
register
mail settings
Submitter Cristiana Voicu
Date Sept. 26, 2012, 8:40 a.m.
Message ID <1348648854-4588-1-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/37241/
State New
Headers show

Comments

Cristiana Voicu - Sept. 26, 2012, 8:40 a.m.
When a user makes a build from a tarball, it shows fatal error in branch field.
Now it not complains as a fatal error. It is a normal message.

[YOCTO #3114]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builddetailspage.py |    2 ++
 1 file changed, 2 insertions(+)
Paul Eggleton - Sept. 26, 2012, 12:44 p.m.
Hi Cristiana,

On Wednesday 26 September 2012 11:40:54 Cristiana Voicu wrote:
> When a user makes a build from a tarball, it shows fatal error in branch
> field. Now it not complains as a fatal error. It is a normal message.
> 
> [YOCTO #3114]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/builddetailspage.py |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
> b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index a927c21..816ffde
> 100755
> --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
> +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
> @@ -99,6 +99,8 @@ class BuildConfigurationTreeView(gtk.TreeView):
>              import os, os.path
>              if os.path.exists(path):
>                  branch = bb.process.run('cd %s; git branch | grep "^* " |
> tr -d "* "' % path)[0] +                if branch.startswith("fatal: Not a
> git repository"): +                    branch = branch[7:]
>                  if branch:
>                      branch = branch.strip('\n')
>                      vars.append(self.set_vars("Branch:", branch))

I'd rather we just show "(unknown)" here if it fails rather than "not a git 
repository..." - could you change it to do that?

Thanks,
Paul

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index a927c21..816ffde 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -99,6 +99,8 @@  class BuildConfigurationTreeView(gtk.TreeView):
             import os, os.path
             if os.path.exists(path):
                 branch = bb.process.run('cd %s; git branch | grep "^* " | tr -d "* "' % path)[0]
+                if branch.startswith("fatal: Not a git repository"):
+                    branch = branch[7:]
                 if branch:
                     branch = branch.strip('\n')
                     vars.append(self.set_vars("Branch:", branch))