)]}'
{"nova/cmd/manage.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fb979171468ea31cbf4548a50cfc683cf44ed700","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    sys.exit(1)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def _uuid_shift(uuid, forward\u003dTrue):"},{"line_number":116,"context_line":"    \"\"\"We need a way to non-destructively modify UUIDs so that we can store a"},{"line_number":117,"context_line":"    marker without having duplicate InstanceMapping entries. This accomplishes"},{"line_number":118,"context_line":"    this by increasing each hex digit in the given UUID by 1 to store the"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_62227ebb","line":115,"updated":"2018-02-01 15:38:01.000000000","message":"I think this idea could work but I have a simpler algorithm to shift and unshift a uuid to another uuid.\nI would simply revers the fragments (separated by \u0027-\u0027) in the uuid with the following:\n\n\u0027-\u0027.join([fragment[::-1] for fragment in uuid.split(\u0027-\u0027)])\n\nIt also has the benefit that shift(shift(uuid)) \u003d\u003d uuid so to unshift an already shifted marker you only need to shift it again.","commit_id":"0d16f71191b4a0088c74f92cbf7fb0bf3e34cae0"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a03a936a132a2d2ef30c1cee08b8708b4ad1a65","unresolved":false,"context_lines":[{"line_number":115,"context_line":"def _uuid_shift(uuid, forward\u003dTrue):"},{"line_number":116,"context_line":"    \"\"\"We need a way to non-destructively modify UUIDs so that we can store a"},{"line_number":117,"context_line":"    marker without having duplicate InstanceMapping entries. This accomplishes"},{"line_number":118,"context_line":"    this by increasing each hex digit in the given UUID by 1 to store the"},{"line_number":119,"context_line":"    marker, and then reversing that to recover the marker value."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    amount \u003d 1 if forward else -1"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_59543953","line":118,"updated":"2018-01-31 18:35:14.000000000","message":"If I understand this correctly, then 3e251 would become 4f362 and shifted back right ?\n\nProbably this is too much of a corner case, but there could be a possibility of such an instance_mapping already existing ? Maybe its not a problem at all, just asking to see if I understood it correctly.","commit_id":"0d16f71191b4a0088c74f92cbf7fb0bf3e34cae0"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"77638b5d566b8245dc9980311f01870fc1c5ae5f","unresolved":false,"context_lines":[{"line_number":115,"context_line":"def _uuid_shift(uuid, forward\u003dTrue):"},{"line_number":116,"context_line":"    \"\"\"We need a way to non-destructively modify UUIDs so that we can store a"},{"line_number":117,"context_line":"    marker without having duplicate InstanceMapping entries. This accomplishes"},{"line_number":118,"context_line":"    this by increasing each hex digit in the given UUID by 1 to store the"},{"line_number":119,"context_line":"    marker, and then reversing that to recover the marker value."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    amount \u003d 1 if forward else -1"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_b2a78fbd","line":118,"in_reply_to":"5f93b717_523e4b8b","updated":"2018-01-31 21:25:38.000000000","message":"Thanks for explaining, makes sense.","commit_id":"0d16f71191b4a0088c74f92cbf7fb0bf3e34cae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"cde941ae96f36a98c67c508f34c7f640f7de1f8c","unresolved":false,"context_lines":[{"line_number":115,"context_line":"def _uuid_shift(uuid, forward\u003dTrue):"},{"line_number":116,"context_line":"    \"\"\"We need a way to non-destructively modify UUIDs so that we can store a"},{"line_number":117,"context_line":"    marker without having duplicate InstanceMapping entries. This accomplishes"},{"line_number":118,"context_line":"    this by increasing each hex digit in the given UUID by 1 to store the"},{"line_number":119,"context_line":"    marker, and then reversing that to recover the marker value."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    amount \u003d 1 if forward else -1"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_523e4b8b","line":118,"in_reply_to":"5f93b717_59543953","updated":"2018-01-31 21:14:45.000000000","message":"Yes, that\u0027s correct. And 8bf2 would become 9c03. It would have the same possibility of existing as any other UUID added to the table, so no, I don\u0027t believe it would pose any more danger of a collision than any other inserted record.","commit_id":"0d16f71191b4a0088c74f92cbf7fb0bf3e34cae0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"034ce321f559aa2480002b00c5f90ffd18b4f168","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    mapper \u003d {\"0\": \"8\", \"1\": \"9\", \"2\": \"a\", \"3\": \"b\", \"4\": \"c\", \"5\": \"d\","},{"line_number":122,"context_line":"              \"6\": \"e\", \"7\": \"f\", \"8\": \"0\", \"9\": \"1\", \"a\": \"2\", \"b\": \"3\","},{"line_number":123,"context_line":"              \"c\": \"4\", \"d\": \"5\", \"e\": \"6\", \"f\": \"7\", \"-\": \"-\"}"},{"line_number":124,"context_line":"    return \"\".join([mapper[char] for char in uuid])"},{"line_number":125,"context_line":"# Since shifting twice returns you to the original, we can alias."},{"line_number":126,"context_line":"_uuid_unshift \u003d _uuid_shift"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_88df960b","line":124,"updated":"2018-02-02 09:42:55.000000000","message":"str.translate() could be used but I guess that just matter of taste:\n\n    import string\n    return uuid.translate(string.maketrans(\u00270123456789abcdef\u0027,\n                                           \u002789abcdef01234567\u0027))","commit_id":"1a54dd871c6734307c3972e1b1db98ea1a8b3114"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"00f194966185c009f77d5a46c7ba0ff90888067f","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    mapper \u003d {\"0\": \"8\", \"1\": \"9\", \"2\": \"a\", \"3\": \"b\", \"4\": \"c\", \"5\": \"d\","},{"line_number":122,"context_line":"              \"6\": \"e\", \"7\": \"f\", \"8\": \"0\", \"9\": \"1\", \"a\": \"2\", \"b\": \"3\","},{"line_number":123,"context_line":"              \"c\": \"4\", \"d\": \"5\", \"e\": \"6\", \"f\": \"7\", \"-\": \"-\"}"},{"line_number":124,"context_line":"    return \"\".join([mapper[char] for char in uuid])"},{"line_number":125,"context_line":"# Since shifting twice returns you to the original, we can alias."},{"line_number":126,"context_line":"_uuid_unshift \u003d _uuid_shift"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_2d1dc80e","line":124,"in_reply_to":"3fa0c359_3b61a537","updated":"2018-02-07 16:48:52.000000000","message":"Ugh, that\u0027s Python2-specific. It\u0027s done in the bytes module in Python3, and there is no simple six translation, so I\u0027ll change it back to the dict mapping.","commit_id":"1a54dd871c6734307c3972e1b1db98ea1a8b3114"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"1ee3e8425fb8cc876692e48fc7f1e29141a44473","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    mapper \u003d {\"0\": \"8\", \"1\": \"9\", \"2\": \"a\", \"3\": \"b\", \"4\": \"c\", \"5\": \"d\","},{"line_number":122,"context_line":"              \"6\": \"e\", \"7\": \"f\", \"8\": \"0\", \"9\": \"1\", \"a\": \"2\", \"b\": \"3\","},{"line_number":123,"context_line":"              \"c\": \"4\", \"d\": \"5\", \"e\": \"6\", \"f\": \"7\", \"-\": \"-\"}"},{"line_number":124,"context_line":"    return \"\".join([mapper[char] for char in uuid])"},{"line_number":125,"context_line":"# Since shifting twice returns you to the original, we can alias."},{"line_number":126,"context_line":"_uuid_unshift \u003d _uuid_shift"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_3b61a537","line":124,"in_reply_to":"5f93b717_88df960b","updated":"2018-02-06 14:44:07.000000000","message":"Heh, I actually did that first, but thought that the dict approach would be cleaner. I\u0027m going to switch it back.","commit_id":"1a54dd871c6734307c3972e1b1db98ea1a8b3114"}]}
