[Bug 3966] New: convert uses wrong TZ when writing .hgtags

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Tue Jun 18 10:03:49 CDT 2013


http://bz.selenic.com/show_bug.cgi?id=3966

          Priority: normal
            Bug ID: 3966
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: convert uses wrong TZ when writing .hgtags
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: john.peacock at messagesystems.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.5.4
         Component: convert
           Product: Mercurial

Using convert to isolate a given directory tree (using filemap), I see that the
date is wrong in the automatic commit to fix up .hgtags:

changeset: [draft] 543:45ecef7efaf3
author:    convert-repo
date:      Tue, 18 Jun 2013 19:08:32 +0000 (4 hours from now)
summary:   update tags

A .hgtags

That should -0400 where I am located (all of the other timestamps are correct).

This seems like the appropriate fix:

diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -203,7 +203,7 @@
             return context.memfilectx(f, data, False, False, None)

         self.ui.status(_("updating tags\n"))
-        date = "%s 0" % int(time.mktime(time.gmtime()))
+        date = "%s 0" % int(time.mktime(time.localtime()))
         extra = {'branch': self.tagsbranch}
         ctx = context.memctx(self.repo, (tagparent, None), "update tags",
                              [".hgtags"], getfilectx, "convert-repo", date,

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list