Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOTIDE-2201 Improve parsing of log output, and fix e-mail address #31

Merged
merged 1 commit into from
Nov 13, 2019

Conversation

westbury
Copy link

Fixes IOTIDE-2201.

The issue was that the author could contain certain characters that broke json parsing. These characters were not previously escaped. This fix makes use of the Mercurial json function to output text in json format correctly. The hack for the description has now been removed, so the description too is parsed as a part of the json.

I also took the opportunity to fix up the name and email of the author. Whereas Git returns these separately, Mercurial returns them as a single string "name ". This had been returned as the name, with the e-mail being blank. This gave a minor inconsistency between Git and Hg. It also meant the correct avatars were not being used in Hg.

' "added": {json(file_adds)},\\n' +
' "modified": {json(file_mods)},\\n' +
' "deleted": {json(file_dels)},\\n' +
' "desc": {json(desc)}\n}';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question about this format. I've seen that @mcgordonite wrote that he created a different template here. this looks slightly different. Is it by design?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think either are fine: this version has the advantage of being trivial to parse with JSON.parse, but the one in your link didn't require as much escaping in the template.

Copy link

@federicobozzini federicobozzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@westbury westbury merged commit 242d197 into release-0.9.0 Nov 13, 2019
@westbury westbury deleted the hg-json-fixes branch February 28, 2020 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants