https://bugs.webkit.org/show_bug.cgi?id=152289
Reviewed by Stephanie Lewis.
Fix various bugs after r194088.
* public/api/commits.php:
(format_commit): Include the commit order.
* public/v2/data.js:
(CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
* tools/pull-os-versions.py:
(OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
(available_builds_from_command): Exit early when an exception is thrown.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194093
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ Using fake timestamp in OS version make some results invisible
+ https://bugs.webkit.org/show_bug.cgi?id=152289
+
+ Reviewed by Stephanie Lewis.
+
+ Fix various bugs after r194088.
+
+ * public/api/commits.php:
+ (format_commit): Include the commit order.
+ * public/v2/data.js:
+ (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
+ * tools/pull-os-versions.py:
+ (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
+ (available_builds_from_command): Exit early when an exception is thrown.
+
2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
Fix a typo in the previous commit.
'revision' => $commit_row['commit_revision'],
'parent' => $commit_row['commit_parent'],
'time' => Database::to_js_time($commit_row['commit_time']),
+ 'order' => $commit_row['commit_order'],
'authorName' => $committer_row ? $committer_row['committer_name'] : null,
'authorEmail' => $committer_row ? $committer_row['committer_account'] : null,
'message' => $commit_row['commit_message']
cachedCommits.commitsByTime.push(commit);
});
- cachedCommits.commitsByTime.sort(function (a, b) { return a.time - b.time; });
+ cachedCommits.commitsByTime.sort(function (a, b) { return a.time && b.time ? (a.time - b.time) : (a.order - b.order); });
cachedCommits.commitsByTime.forEach(function (commit, index) { commit.cacheIndex = index; });
}
kind = ord(match.group('kind').upper()) - ord('A')
minor = int(match.group('minor'))
variant = ord(match.group('variant').upper()) - ord('A') + 1 if match.group('variant') else 0
- # These fake times won't conflict with real commit time since even 99Z9999z is still in Feb 1973
- fake_time = datetime.utcfromtimestamp((major * 100 + kind) * 10000 + minor + float(variant) / 100)
- commit['order'] = fake_time.isoformat()
+ commit['order'] = ((major * 100 + kind) * 10000 + minor) * 100 + variant
def available_builds_from_command(repository_name, command, lines_to_ignore):
output = subprocess.check_output(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as error:
print "Failed:", str(error)
+ return []
regex = re.compile(lines_to_ignore)
return [{'repository': repository_name, 'revision': line} for line in output.split('\n') if not regex.match(line)]