| Index: chrome/common/extensions/docs/server2/branch_utility.py
|
| diff --git a/chrome/common/extensions/docs/server2/branch_utility.py b/chrome/common/extensions/docs/server2/branch_utility.py
|
| index 1c683c682104d2cd6f9936e9da9647bde0ed3ffe..4f4911388008333cccb89fa32d40e985ff4bc83f 100644
|
| --- a/chrome/common/extensions/docs/server2/branch_utility.py
|
| +++ b/chrome/common/extensions/docs/server2/branch_utility.py
|
| @@ -137,14 +137,23 @@ class BranchUtility(object):
|
|
|
| version_json = json.loads(self._history_result.Get().content)
|
| for entry in version_json['events']:
|
| - # Here, entry['title'] looks like: 'title - version#.#.branch#.#'
|
| + # Here, entry['title'] looks like: '<title> - <version>.##.<branch>.##'
|
| version_title = entry['title'].split(' - ')[1].split('.')
|
| if version_title[0] == str(version):
|
| self._branch_object_store.Set(str(version), version_title[2])
|
| return int(version_title[2])
|
|
|
| - raise ValueError(
|
| - 'The branch for %s could not be found.' % version)
|
| + raise ValueError('The branch for %s could not be found.' % version)
|
| +
|
| + def GetChannelForVersion(self, version):
|
| + '''Returns the name of the development channel corresponding to a given
|
| + version number.
|
| + '''
|
| + for channel_info in self.GetAllChannelInfo():
|
| + if channel_info.channel == 'stable' and version <= channel_info.version:
|
| + return channel_info.channel
|
| + if version == channel_info.version:
|
| + return channel_info.channel
|
|
|
| def GetLatestVersionNumber(self):
|
| '''Returns the most recent version number found using data stored on
|
|
|