{"thread":{"id":"34606","subject":"[bug] remotes-hg: timezones are transformed","startedAt":"2013-08-03T16:36:23Z","lastAt":"2013-08-04T13:03:51Z","messageCount":3,"participants":["Jörn Hees","Felipe Contreras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"224527","messageId":"EDA1C92E-6872-40D5-8C25-89C3FFF62F7A@joernhees.de","threadId":"34606","inReplyTo":null,"subject":"[bug] remotes-hg: timezones are transformed","fromName":"Jörn Hees","fromEmail":"dev@joernhees.de","sentAt":"2013-08-03T16:36:23Z","receivedAt":"2013-08-03T16:36:23Z","isPatch":false,"sender":{"key":"dev@joernhees.de","avatar":"https://gravatar.com/avatar/590cc6f9e7423070747b155451ff7227c749cc3d3621359f2f3eddce0099a8f4?d=mp&s=160"},"body":"Hi,\n\nit seems that if you use the 1.8.3.4 remote-helpers/git-remote-hg to clone a mercurial repo the timezone information of commits gets transformed into your current timezone.\n(command: git clone hg::…)\n\nI noticed this when a colleague in another timezone used Kiln to also export the same mercurial repo that i had cloned from git before.\nFetching from his git repo gives me a \"second root tree\" with all commits duplicated.\nA git show of two equivalent commit reveals that the Date: line of the commits changed.\nTracking this back into the original mercurial repo reveals that _his_ times are correct.\n\nThis will also make two or more clones from different timezones all using the same hg remote repo incompatible!\n\n\nExample:\nOriginal mercurial commit (timezone: -7200 = -4h)\nhttps://bitbucket.org/lipis/gae-init/commits/a43078f90e727a13767cf14c740157763fb423b5/raw/\n\nLipis git export via Kiln: (-4h)\nhttps://github.com/lipis/gae-init/commit/36b7cabf03fbba784cc41b63430433e9fc79ca8c\n\nMy export via git clone hg::ssh://hg@bitbucket.org/lipis/gae-init (+2h)\nhttps://github.com/joernhees/git-hg-remote-bug_gae-init/commit/8341bf10f1f0a7a924717a8a2c1770f61acd51ae\n\nExpected would be that the hashes of both git exports are the same. His are correct as far as i can tell.\n\n\nCheers,\nJörn\n"},{"id":"224545","messageId":"CAMP44s0aiv7rNCFgQ4hz_KOMRJ5F4CXFTXME73biNA4Nv3Vwdw@mail.gmail.com","threadId":"34606","inReplyTo":"EDA1C92E-6872-40D5-8C25-89C3FFF62F7A@joernhees.de","subject":"Re: [bug] remotes-hg: timezones are transformed","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-03T23:17:43Z","receivedAt":"2013-08-03T23:17:43Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nOn Sat, Aug 3, 2013 at 11:36 AM, Jörn Hees <dev@joernhees.de> wrote:\n\n> it seems that if you use the 1.8.3.4 remote-helpers/git-remote-hg to clone a mercurial repo the timezone information of commits gets transformed into your current timezone.\n> (command: git clone hg::…)\n>\n> I noticed this when a colleague in another timezone used Kiln to also export the same mercurial repo that i had cloned from git before.\n> Fetching from his git repo gives me a \"second root tree\" with all commits duplicated.\n> A git show of two equivalent commit reveals that the Date: line of the commits changed.\n> Tracking this back into the original mercurial repo reveals that _his_ times are correct.\n>\n> This will also make two or more clones from different timezones all using the same hg remote repo incompatible!\n>\n>\n> Example:\n> Original mercurial commit (timezone: -7200 = -4h)\n> https://bitbucket.org/lipis/gae-init/commits/a43078f90e727a13767cf14c740157763fb423b5/raw/\n>\n> Lipis git export via Kiln: (-4h)\n> https://github.com/lipis/gae-init/commit/36b7cabf03fbba784cc41b63430433e9fc79ca8c\n>\n> My export via git clone hg::ssh://hg@bitbucket.org/lipis/gae-init (+2h)\n> https://github.com/joernhees/git-hg-remote-bug_gae-init/commit/8341bf10f1f0a7a924717a8a2c1770f61acd51ae\n\nActually our version is the correct one:\n\n% hg commit -m one -d \"2012-04-28 11:28 +0200\"\n% hg export\n# HG changeset patch\n# User Felipe Contreras <felipe.contreras@gmail.com>\n# Date 1335605280 -7200\n#      Sat Apr 28 11:28:00 2012 +0200\n\n-- \nFelipe Contreras\n"},{"id":"224551","messageId":"9C887272-8580-4198-B136-CDA45C5E4B2C@joernhees.de","threadId":"34606","inReplyTo":"CAMP44s0aiv7rNCFgQ4hz_KOMRJ5F4CXFTXME73biNA4Nv3Vwdw@mail.gmail.com","subject":"Re: [bug resolved] remotes-hg: timezones are transformed","fromName":"Jörn Hees","fromEmail":"dev@joernhees.de","sentAt":"2013-08-04T13:03:51Z","receivedAt":"2013-08-04T13:03:51Z","isPatch":false,"sender":{"key":"dev@joernhees.de","avatar":"https://gravatar.com/avatar/590cc6f9e7423070747b155451ff7227c749cc3d3621359f2f3eddce0099a8f4?d=mp&s=160"},"body":"Hi,\n\nOn 4 Aug 2013, at 01:17, Felipe Contreras <felipe.contreras@gmail.com> wrote:\n> On Sat, Aug 3, 2013 at 11:36 AM, Jörn Hees <dev@joernhees.de> wrote:\n> \n>> it seems that if you use the 1.8.3.4 remote-helpers/git-remote-hg to clone a mercurial repo the timezone information of commits gets transformed into your current timezone.\n>> (command: git clone hg::…)\n>> \n>> I noticed this when a colleague in another timezone used Kiln to also export the same mercurial repo that i had cloned from git before.\n>> Fetching from his git repo gives me a \"second root tree\" with all commits duplicated.\n>> A git show of two equivalent commit reveals that the Date: line of the commits changed.\n>> Tracking this back into the original mercurial repo reveals that _his_ times are correct.\n>> \n>> This will also make two or more clones from different timezones all using the same hg remote repo incompatible!\n>> \n>> \n>> Example:\n>> Original mercurial commit (timezone: -7200 = -4h)\n>> https://bitbucket.org/lipis/gae-init/commits/a43078f90e727a13767cf14c740157763fb423b5/raw/\n\nsorry, i feel stupid for this now… this obviously is -2h:  2*60*60… not 4\n(but see below)\n\n\n>> Lipis git export via Kiln: (-4h)\n>> https://github.com/lipis/gae-init/commit/36b7cabf03fbba784cc41b63430433e9fc79ca8c\n\nso is this: it should've said -2h\n\n\n>> My export via git clone hg::ssh://hg@bitbucket.org/lipis/gae-init (+2h)\n>> https://github.com/joernhees/git-hg-remote-bug_gae-init/commit/8341bf10f1f0a7a924717a8a2c1770f61acd51ae\n\nthis one was correct: +2h\n\n\n> Actually our version is the correct one:\n> \n> % hg commit -m one -d \"2012-04-28 11:28 +0200\"\n> % hg export\n> # HG changeset patch\n> # User Felipe Contreras <felipe.contreras@gmail.com>\n> # Date 1335605280 -7200\n> #      Sat Apr 28 11:28:00 2012 +0200\n\n\nThanks for clarifying this. I had falsely assumed that no one would dare to flip the sign of the timezone spec.\nTurns out that mercurial commits contain the _negative_ timezone offset in seconds, so UTC+2 will actually be saved as -7200!\nI was actually still doubtful so i searched for some credible ref and was able to find this insanity documented in \"hg help dates\":\n> - \"1165432709 0\" (Wed Dec 6 13:18:29 2006 UTC)\n> \n>     This is the internal representation format for dates. The first number is\n>     the number of seconds since the epoch (1970-01-01 00:00 UTC). The second\n>     is the offset of the local timezone, in seconds west of UTC (negative if\n>     the timezone is east of UTC).\nI use the word insane here, as there are many standards for date times, but not one dares to switch the timezone sign!\nhttps://en.wikipedia.org/wiki/Time_zone\nhttps://upload.wikimedia.org/wikipedia/commons/a/ad/Standard_time_zones_of_the_world.png\n\n\nI'm sorry for reporting this as a bug and instead have to pull my hat.\n\nCheers,\nJörn\n"}]}