Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone hg repository doesn't work under Cygwin #100

Open
richard42 opened this issue Aug 6, 2015 · 0 comments
Open

Clone hg repository doesn't work under Cygwin #100

richard42 opened this issue Aug 6, 2015 · 0 comments

Comments

@richard42
Copy link

Due to lack of the '%s' format specifier in the 'strftime' function in Cygwin. Here is a patch which fixes this:

diff --git a/gitifyhg/hgimporter.py b/gitifyhg/hgimporter.py
index 1ff9766..bee1b7d 100644
--- a/gitifyhg/hgimporter.py
+++ b/gitifyhg/hgimporter.py
@@ -18,6 +18,7 @@
 # Some of this code comes from https://github.com/felipec/git/tree/fc/remote/hg
 # but much of it has been rewritten.

+import calendar
 import time
 import re

@@ -113,7 +114,7 @@ class HGImporter(object):
             return
         output("commit refs/notes/hg-%s" % (self.hgremote.uuid))
         output("mark :%d" % (self.marks.new_notes_mark()))
-        output("committer <gitifyhg-note> %s" % (time.strftime('%s %z')))
+        output("committer <gitifyhg-note> %i %s" % (calendar.timegm(time.gmtime()), time.strftime('%z')))
         message = u"hg from %s (%s)\n" % (self.prefix, self.hgremote.url)
         message = message.encode("utf-8")
         output("data %d" % (len(message)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant