Permalink
Browse files

Preserve bookmark timestamps during Delicious import.

  • Loading branch information...
1 parent d8f9b8b commit b3912ba3ea9b8c83099011c87b0912280db13782 @ashearer ashearer committed Dec 17, 2010
Showing with 8 additions and 1 deletion.
  1. +8 −1 delicious_import.py
View
@@ -37,9 +37,16 @@ def __init__(self, username, password=''):
options['push'] = False
options['msg'] = desc
- args = [url]
+ # Set the authoring date of the commit based on the imported
+ # timestamp. git reads the GIT_AUTHOR_DATE environment var.
+ os.environ['GIT_AUTHOR_DATE'] = timestamp
+ args = [url]
g = gitMark(options, args)
+
+ # Reset authoring timestamp (abundance of caution)
+ del os.environ['GIT_AUTHOR_DATE']
+
if post_list.length > 1:
print '%d of %d bookmarks imported (%d%%)' % (
post_index + 1, post_list.length,

0 comments on commit b3912ba

Please sign in to comment.