Bug 1156278: Make query_branch() more robust.
authorWander Lairson Costa <wcosta@mozilla.com>
Mon, 20 Apr 2015 18:32:25 -0300 (2015-04-20)
changeset 3900 82e00ba4a3d355c6d7952e4b6b4e68789ed4cf65
parent 3896 b693ae365bfae65e299a3a45a53c848d4407a866
child 3901 64ab381463bb2dbc21b4ee18c5a22a2f09d245eb
push id3085
push userwcosta@mozilla.com
push dateMon, 20 Apr 2015 21:49:20 +0000 (2015-04-20)
bugs1156278
Bug 1156278: Make query_branch() more robust. If a trailing slash exists in the repo name, query_branch fails returning an empty string. We fix that by stripping trailing slashes.
scripts/b2g_build.py
--- a/scripts/b2g_build.py
+++ b/scripts/b2g_build.py
@@ -186,17 +186,17 @@ class B2GBuild(LocalesMixin, PurgeMixin,
         abs_dirs.update(dirs)
         self.abs_dirs = abs_dirs
         return self.abs_dirs
 
     def query_branch(self):
         if self.buildbot_config and 'properties' in self.buildbot_config:
             return self.buildbot_config['properties']['branch']
         else:
-            return os.path.basename(self.query_repo())
+            return os.path.basename(self.query_repo().rstrip('/'))
 
     def query_buildid(self):
         if self.buildid:
             return self.buildid
         platform_ini = os.path.join(self.query_device_outputdir(),
                                     'system', 'b2g', 'platform.ini')
         data = self.read_from_file(platform_ini)
         buildid = re.search("^BuildID=(\d+)$", data, re.M)