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