Show More
@@ -144,7 +144,9 b' class _nullconverter(object):' | |||
|
144 | 144 | @staticmethod |
|
145 | 145 | def formatdate(date, fmt): |
|
146 | 146 | '''convert date tuple to appropriate format''' |
|
147 | return date | |
|
147 | # timestamp can be float, but the canonical form should be int | |
|
148 | ts, tz = date | |
|
149 | return (int(ts), tz) | |
|
148 | 150 | @staticmethod |
|
149 | 151 | def formatdict(data, key, value, fmt, sep): |
|
150 | 152 | '''convert dict or key-value pairs to appropriate dict format''' |
@@ -165,7 +165,7 b' Templated output to stdout:' | |||
|
165 | 165 | [ |
|
166 | 166 | { |
|
167 | 167 | "branch": "default", |
|
168 |
"date": [0 |
|
|
168 | "date": [0, 0], | |
|
169 | 169 | "desc": "foo-0", |
|
170 | 170 | "diff": "diff -r 000000000000 -r 871558de6af2 foo\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -0,0 +1,1 @@\n+foo-0\n", |
|
171 | 171 | "node": "871558de6af2e8c244222f8eea69b782c94ce3df", |
@@ -181,7 +181,7 b' Templated output to single file:' | |||
|
181 | 181 | [ |
|
182 | 182 | { |
|
183 | 183 | "branch": "default", |
|
184 |
"date": [0 |
|
|
184 | "date": [0, 0], | |
|
185 | 185 | "desc": "foo-0", |
|
186 | 186 | "diff": "diff -r 000000000000 -r 871558de6af2 foo\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -0,0 +1,1 @@\n+foo-0\n", |
|
187 | 187 | "node": "871558de6af2e8c244222f8eea69b782c94ce3df", |
@@ -190,7 +190,7 b' Templated output to single file:' | |||
|
190 | 190 | }, |
|
191 | 191 | { |
|
192 | 192 | "branch": "default", |
|
193 |
"date": [0 |
|
|
193 | "date": [0, 0], | |
|
194 | 194 | "desc": "foo-1", |
|
195 | 195 | "diff": "diff -r 871558de6af2 -r d1c9656e973c foo\n--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +1,2 @@\n foo-0\n+foo-1\n", |
|
196 | 196 | "node": "d1c9656e973cfb5aebd5499bbd2cb350e3b12266", |
@@ -206,7 +206,7 b' Templated output to multiple files:' | |||
|
206 | 206 | [ |
|
207 | 207 | { |
|
208 | 208 | "branch": "default", |
|
209 |
"date": [0 |
|
|
209 | "date": [0, 0], | |
|
210 | 210 | "desc": "foo-0", |
|
211 | 211 | "diff": "diff -r 000000000000 -r 871558de6af2 foo\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -0,0 +1,1 @@\n+foo-0\n", |
|
212 | 212 | "node": "871558de6af2e8c244222f8eea69b782c94ce3df", |
@@ -218,7 +218,7 b' Templated output to multiple files:' | |||
|
218 | 218 | [ |
|
219 | 219 | { |
|
220 | 220 | "branch": "default", |
|
221 |
"date": [0 |
|
|
221 | "date": [0, 0], | |
|
222 | 222 | "desc": "foo-1", |
|
223 | 223 | "diff": "diff -r 871558de6af2 -r d1c9656e973c foo\n--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +1,2 @@\n foo-0\n+foo-1\n", |
|
224 | 224 | "node": "d1c9656e973cfb5aebd5499bbd2cb350e3b12266", |
@@ -58,7 +58,7 b' simple JSON (no "change" field)' | |||
|
58 | 58 | $ hg grep -Tjson port |
|
59 | 59 | [ |
|
60 | 60 | { |
|
61 |
"date": [4 |
|
|
61 | "date": [4, 0], | |
|
62 | 62 | "file": "port", |
|
63 | 63 | "line_number": 1, |
|
64 | 64 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
@@ -67,7 +67,7 b' simple JSON (no "change" field)' | |||
|
67 | 67 | "user": "spam" |
|
68 | 68 | }, |
|
69 | 69 | { |
|
70 |
"date": [4 |
|
|
70 | "date": [4, 0], | |
|
71 | 71 | "file": "port", |
|
72 | 72 | "line_number": 2, |
|
73 | 73 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
@@ -76,7 +76,7 b' simple JSON (no "change" field)' | |||
|
76 | 76 | "user": "spam" |
|
77 | 77 | }, |
|
78 | 78 | { |
|
79 |
"date": [4 |
|
|
79 | "date": [4, 0], | |
|
80 | 80 | "file": "port", |
|
81 | 81 | "line_number": 3, |
|
82 | 82 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
@@ -91,7 +91,7 b' simple JSON without matching lines' | |||
|
91 | 91 | $ hg grep -Tjson -l port |
|
92 | 92 | [ |
|
93 | 93 | { |
|
94 |
"date": [4 |
|
|
94 | "date": [4, 0], | |
|
95 | 95 | "file": "port", |
|
96 | 96 | "line_number": 1, |
|
97 | 97 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
@@ -119,7 +119,7 b' all JSON' | |||
|
119 | 119 | [ |
|
120 | 120 | { |
|
121 | 121 | "change": "-", |
|
122 |
"date": [4 |
|
|
122 | "date": [4, 0], | |
|
123 | 123 | "file": "port", |
|
124 | 124 | "line_number": 4, |
|
125 | 125 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
@@ -129,7 +129,7 b' all JSON' | |||
|
129 | 129 | }, |
|
130 | 130 | { |
|
131 | 131 | "change": "+", |
|
132 |
"date": [3 |
|
|
132 | "date": [3, 0], | |
|
133 | 133 | "file": "port", |
|
134 | 134 | "line_number": 4, |
|
135 | 135 | "node": "95040cfd017d658c536071c6290230a613c4c2a6", |
@@ -139,7 +139,7 b' all JSON' | |||
|
139 | 139 | }, |
|
140 | 140 | { |
|
141 | 141 | "change": "-", |
|
142 |
"date": [2 |
|
|
142 | "date": [2, 0], | |
|
143 | 143 | "file": "port", |
|
144 | 144 | "line_number": 1, |
|
145 | 145 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
@@ -149,7 +149,7 b' all JSON' | |||
|
149 | 149 | }, |
|
150 | 150 | { |
|
151 | 151 | "change": "-", |
|
152 |
"date": [2 |
|
|
152 | "date": [2, 0], | |
|
153 | 153 | "file": "port", |
|
154 | 154 | "line_number": 2, |
|
155 | 155 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
@@ -159,7 +159,7 b' all JSON' | |||
|
159 | 159 | }, |
|
160 | 160 | { |
|
161 | 161 | "change": "+", |
|
162 |
"date": [2 |
|
|
162 | "date": [2, 0], | |
|
163 | 163 | "file": "port", |
|
164 | 164 | "line_number": 1, |
|
165 | 165 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
@@ -169,7 +169,7 b' all JSON' | |||
|
169 | 169 | }, |
|
170 | 170 | { |
|
171 | 171 | "change": "+", |
|
172 |
"date": [2 |
|
|
172 | "date": [2, 0], | |
|
173 | 173 | "file": "port", |
|
174 | 174 | "line_number": 2, |
|
175 | 175 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
@@ -179,7 +179,7 b' all JSON' | |||
|
179 | 179 | }, |
|
180 | 180 | { |
|
181 | 181 | "change": "+", |
|
182 |
"date": [2 |
|
|
182 | "date": [2, 0], | |
|
183 | 183 | "file": "port", |
|
184 | 184 | "line_number": 3, |
|
185 | 185 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
@@ -189,7 +189,7 b' all JSON' | |||
|
189 | 189 | }, |
|
190 | 190 | { |
|
191 | 191 | "change": "+", |
|
192 |
"date": [1 |
|
|
192 | "date": [1, 0], | |
|
193 | 193 | "file": "port", |
|
194 | 194 | "line_number": 2, |
|
195 | 195 | "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587", |
@@ -199,7 +199,7 b' all JSON' | |||
|
199 | 199 | }, |
|
200 | 200 | { |
|
201 | 201 | "change": "+", |
|
202 |
"date": [0 |
|
|
202 | "date": [0, 0], | |
|
203 | 203 | "file": "port", |
|
204 | 204 | "line_number": 1, |
|
205 | 205 | "node": "f31323c9217050ba245ee8b537c713ec2e8ab226", |
@@ -147,7 +147,7 b' Test that verbose, JSON, template and co' | |||
|
147 | 147 | [ |
|
148 | 148 | { |
|
149 | 149 | "command": "up", |
|
150 |
"date": [5 |
|
|
150 | "date": [5, 0], | |
|
151 | 151 | "name": ".", |
|
152 | 152 | "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
153 | 153 | "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
@@ -155,7 +155,7 b' Test that verbose, JSON, template and co' | |||
|
155 | 155 | }, |
|
156 | 156 | { |
|
157 | 157 | "command": "up 0", |
|
158 |
"date": [2 |
|
|
158 | "date": [2, 0], | |
|
159 | 159 | "name": ".", |
|
160 | 160 | "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
161 | 161 | "oldhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
@@ -163,7 +163,7 b' Test that verbose, JSON, template and co' | |||
|
163 | 163 | }, |
|
164 | 164 | { |
|
165 | 165 | "command": "commit -Aqm b", |
|
166 |
"date": [1 |
|
|
166 | "date": [1, 0], | |
|
167 | 167 | "name": ".", |
|
168 | 168 | "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"], |
|
169 | 169 | "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
@@ -171,7 +171,7 b' Test that verbose, JSON, template and co' | |||
|
171 | 171 | }, |
|
172 | 172 | { |
|
173 | 173 | "command": "commit -Aqm a", |
|
174 |
"date": [0 |
|
|
174 | "date": [0, 0], | |
|
175 | 175 | "name": ".", |
|
176 | 176 | "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"], |
|
177 | 177 | "oldhashes": ["0000000000000000000000000000000000000000"], |
@@ -715,49 +715,49 b' List of all markers in JSON' | |||
|
715 | 715 | $ hg debugobsolete -Tjson |
|
716 | 716 | [ |
|
717 | 717 | { |
|
718 |
"date": [1339 |
|
|
718 | "date": [1339, 0], | |
|
719 | 719 | "flag": 0, |
|
720 | 720 | "metadata": {"user": "test"}, |
|
721 | 721 | "prednode": "1339133913391339133913391339133913391339", |
|
722 | 722 | "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"] |
|
723 | 723 | }, |
|
724 | 724 | { |
|
725 |
"date": [1339 |
|
|
725 | "date": [1339, 0], | |
|
726 | 726 | "flag": 0, |
|
727 | 727 | "metadata": {"user": "test"}, |
|
728 | 728 | "prednode": "1337133713371337133713371337133713371337", |
|
729 | 729 | "succnodes": ["5601fb93a350734d935195fee37f4054c529ff39"] |
|
730 | 730 | }, |
|
731 | 731 | { |
|
732 |
"date": [121 |
|
|
732 | "date": [121, 120], | |
|
733 | 733 | "flag": 12, |
|
734 | 734 | "metadata": {"user": "test"}, |
|
735 | 735 | "prednode": "245bde4270cd1072a27757984f9cda8ba26f08ca", |
|
736 | 736 | "succnodes": ["cdbce2fbb16313928851e97e0d85413f3f7eb77f"] |
|
737 | 737 | }, |
|
738 | 738 | { |
|
739 |
"date": [1338 |
|
|
739 | "date": [1338, 0], | |
|
740 | 740 | "flag": 1, |
|
741 | 741 | "metadata": {"user": "test"}, |
|
742 | 742 | "prednode": "5601fb93a350734d935195fee37f4054c529ff39", |
|
743 | 743 | "succnodes": ["6f96419950729f3671185b847352890f074f7557"] |
|
744 | 744 | }, |
|
745 | 745 | { |
|
746 |
"date": [1338 |
|
|
746 | "date": [1338, 0], | |
|
747 | 747 | "flag": 0, |
|
748 | 748 | "metadata": {"user": "test"}, |
|
749 | 749 | "prednode": "ca819180edb99ed25ceafb3e9584ac287e240b00", |
|
750 | 750 | "succnodes": ["1337133713371337133713371337133713371337"] |
|
751 | 751 | }, |
|
752 | 752 | { |
|
753 |
"date": [1337 |
|
|
753 | "date": [1337, 0], | |
|
754 | 754 | "flag": 0, |
|
755 | 755 | "metadata": {"user": "test"}, |
|
756 | 756 | "prednode": "cdbce2fbb16313928851e97e0d85413f3f7eb77f", |
|
757 | 757 | "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"] |
|
758 | 758 | }, |
|
759 | 759 | { |
|
760 |
"date": [0 |
|
|
760 | "date": [0, 0], | |
|
761 | 761 | "flag": 0, |
|
762 | 762 | "metadata": {"user": "test"}, |
|
763 | 763 | "parentnodes": ["6f96419950729f3671185b847352890f074f7557"], |
@@ -1555,7 +1555,7 b' only a subset of those are displayed (be' | |||
|
1555 | 1555 | $ hg debugobsolete --index --rev "3+7" -Tjson |
|
1556 | 1556 | [ |
|
1557 | 1557 | { |
|
1558 |
"date": [0 |
|
|
1558 | "date": [0, 0], | |
|
1559 | 1559 | "flag": 0, |
|
1560 | 1560 | "index": 1, |
|
1561 | 1561 | "metadata": {"ef1": "1", "operation": "amend", "user": "test"}, |
@@ -1563,7 +1563,7 b' only a subset of those are displayed (be' | |||
|
1563 | 1563 | "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"] |
|
1564 | 1564 | }, |
|
1565 | 1565 | { |
|
1566 |
"date": [0 |
|
|
1566 | "date": [0, 0], | |
|
1567 | 1567 | "flag": 0, |
|
1568 | 1568 | "index": 3, |
|
1569 | 1569 | "metadata": {"ef1": "1", "operation": "amend", "user": "test"}, |
General Comments 0
You need to be logged in to leave comments.
Login now