From 242931c79989b23e6601c877fc24992b8b74ab9c Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 12 Feb 2007 01:22:38 +0100 Subject: [PATCH] docs, (c) header, switch off reflogs. --- darcs2git.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/darcs2git.py b/darcs2git.py index 21d2f68..ca15bf1 100644 --- a/darcs2git.py +++ b/darcs2git.py @@ -1,3 +1,19 @@ +# +# Copyright (c) 2007 Han-Wen Nienhuys +# +# Distributed under terms of the GNU General Public License +# This program comes with NO WARRANTY. +# +# +# +# TODO: +# - time zones +# - use pull/unpull for creating conversion repo +# - file modes +# +# + + import os import sys import time @@ -32,18 +48,13 @@ def get_cli_options (): p.usage='''darcs2git [OPTIONS] DARCS-REPO''' p.description='''Convert darcs repo to git. -This tool is a one shot conversion utility for Darcs repositories. It -requires Git version that has git-fast-import. It does not support -incremental updating. +This tool is a conversion utility for Darcs repositories. It requires +a Git version that has git-fast-import. It does not support incremental +updating. This tool will import the patches in chronological order, and only creates merges when a resolved conflict is detected. -TODO: - -- correct time zone handling -- - ''' def update_map (option, opt, value, parser): @@ -305,8 +316,8 @@ def export_commit (repo, patch, last_patch, gfi): gfi.write ('commit refs/heads/darcstmp%d\n' % patch.number) gfi.write ('mark :%d\n' % (patch.number + 1)) gfi.write ('committer %s <%s> %s\n' % (patch.author_name, - patch.author_mail, - patch.date)) + patch.author_mail, + patch.date)) gfi.write ('data %d\n%s\n' % (len (patch.message), patch.message)) if last_patch: gfi.write ('from :%d\n' % (last_patch.number + 1)) @@ -365,6 +376,8 @@ def main (): git_repo = os.path.abspath (options.target_git_repo) system ('mkdir %(git_repo)s && cd %(git_repo)s && git --bare init' % locals ()) + system ('git --git-dir %(git_repo)s repo-config core.logAllRefUpdates false' % locals ()) + os.environ['GIT_DIR'] = git_repo gfi = os.popen ('git-fast-import', 'w') # -- 2.11.4.GIT