Skip to content

Commit b3912ba

Browse files
committed
Preserve bookmark timestamps during Delicious import.
1 parent d8f9b8b commit b3912ba

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

delicious_import.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ def __init__(self, username, password=''):
3737
options['push'] = False
3838
options['msg'] = desc
3939

40-
args = [url]
40+
# Set the authoring date of the commit based on the imported
41+
# timestamp. git reads the GIT_AUTHOR_DATE environment var.
42+
os.environ['GIT_AUTHOR_DATE'] = timestamp
4143

44+
args = [url]
4245
g = gitMark(options, args)
46+
47+
# Reset authoring timestamp (abundance of caution)
48+
del os.environ['GIT_AUTHOR_DATE']
49+
4350
if post_list.length > 1:
4451
print '%d of %d bookmarks imported (%d%%)' % (
4552
post_index + 1, post_list.length,

0 commit comments

Comments
 (0)