##// END OF EJS Templates
util.datestr: do not crash on revisions with negative timestamp (issue2513)...
util.datestr: do not crash on revisions with negative timestamp (issue2513) Python's time.gmtime(lt) fails on Windows, producing a traceback with ValueError: (22, 'Invalid argument') if lt < -43200. We get a local time boundary value of -43200 if we take "the epoch" Thu Jan 01 00:00:00 1970 = time.gmtime(0) from timezone 'UTC+0' into timezone 'UTC-12'. All other timezones will have larger local time values for that point in time. Aborting with a traceback on 'hg log' for revisions with a timestamp value < -43200 is clearly not acceptable. Returning "invalid timestamp" or similar as string representation is not an option either, since that may crash other tools which parse the output of 'hg log'. Instead, we teach util.datestr() to return the epoch in timezone UTC+0 on *all platforms*, represented by the string Thu Jan 01 00:00:00 1970 +0000 if the timestamp's unix time value is negative. (based on a patch originally proposed by Benjamin Pollack)

File last commit:

r12830:d8205dac stable
r13039:dd24f3e7 stable
Show More
guids.wxi
46 lines | 2.2 KiB | text/plain | TextLexer
<Include>
<!-- These are component GUIDs used for Mercurial installers.
YOU MUST CHANGE ALL GUIDs below when copying this file
and replace 'Mercurial' in this notice with the name of
your project. Component GUIDs have global namespace! -->
<!-- contrib.wxs -->
<?define contrib.guid = {F17D27B7-4A6B-4cd2-AE72-FED3CFAA585E} ?>
<?define contrib.vim.guid = {BB04903A-652D-4C4F-9590-2BD07A2304F2} ?>
<!-- doc.wxs -->
<?define doc.hg.1.html.guid = {AAAA3FDA-EDC5-4220-B59D-D342722358A2} ?>
<?define doc.hgignore.5.html.guid = {AA9118C4-F3A0-4429-A5F4-5A1906B2D67F} ?>
<?define doc.hgrc.5.html = {E0CEA1EB-FA01-408c-844B-EE5965165BAE} ?>
<?define doc.style.css = {172F8262-98E0-4711-BD39-4DAE0D77EF05} ?>
<!-- help.wxs -->
<?define helpFolder.guid = {21FE9CF9-933E-4C2E-B2EC-413A569FB996} ?>
<!-- i18n.wxs -->
<?define i18nFolder.guid = {EADFA693-A0B5-4f31-87C9-3997CFAC1B42} ?>
<!-- templates.wxs -->
<?define templates.root.guid = {111509CB-4C96-4035-80BC-F66A99CD5ACB} ?>
<?define templates.atom.guid = {45FCDF84-DE27-44f4-AF6C-C41F5994AE0D} ?>
<?define templates.coal.guid = {B63CCAAB-4EAF-43b4-901E-4BD13F5B78FC} ?>
<?define templates.gitweb.guid = {D8BFE3ED-06DD-4C4D-A00D-6D825955F922} ?>
<?define templates.monoblue.guid = {A394B4D5-2AF7-4AAC-AEA8-E92176E5501E} ?>
<?define templates.paper.guid = {7C94B80D-FD0D-44E7-8489-F30A9E20A47F} ?>
<?define templates.raw.guid = {04DE03A2-FBFD-4c5f-8DEA-5436DDF4689D} ?>
<?define templates.rss.guid = {A7D608DE-0CF6-44f4-AF1E-EE30CC237FDA} ?>
<?define templates.spartan.guid = {80222625-FA8F-44b1-86CE-1781EF375D09} ?>
<?define templates.static.guid = {68C9F843-DE7E-480f-9DA2-D220B19D02C3} ?>
<!-- mercurial.wxs -->
<?define ProductUpgradeCode = {A1CC6134-E945-4399-BE36-EB0017FDF7CF} ?>
<?define ComponentMainExecutableGUID = {D102B8FA-059B-4ACC-9FA3-8C78C3B58EEF} ?>
<?define ReadMe.guid = {56A8E372-991D-4DCA-B91D-93D775974CF5} ?>
<?define COPYING.guid = {B7801DBA-1C49-4BF4-91AD-33C65F5C7895} ?>
<?define mercurial.rc.guid = {1D5FAEEE-7E6E-43B1-9F7F-802714316B15} ?>
<?define mergetools.rc.guid = {E8A1DC29-FF40-4B5F-BD12-80B9F7BF0CCD} ?>
<?define ProgramMenuDir.guid = {D5A63320-1238-489B-B68B-CF053E9577CA} ?>
</Include>