From 33cb89e1df8f94a64ac5da22b1a0c53446b96578 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 19 Aug 2007 14:31:45 -0300 Subject: [PATCH] test_conversion thinkos. - do diff before removing git checkout. - only show 1k of the diff. --- darcs2git.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/darcs2git.py b/darcs2git.py index dae45b8..847e1fc 100644 --- a/darcs2git.py +++ b/darcs2git.py @@ -677,14 +677,15 @@ def test_conversion (darcs_repo, git_repo): gd = options.basename + '.checkouttmp.git' system ('rm -rf %(gd)s && git clone %(git_repo)s %(gd)s' % locals ()) diff_cmd = 'diff --exclude .git -urN %(gd)s %(pristine)s' % locals () - system ('rm -rf %(gd)s' % locals ()) - diff = read_pipe (diff_cmd, ignore_errors=True) + system ('rm -rf %(gd)s' % locals ()) + if diff: if len (diff) > 1024: - diff = diff[:512] + '\n...\n' + diff[512:] + diff = diff[:512] + '\n...\n' + diff[-512:] progress ("Conversion introduced changes: %s" % diff) + raise 'fdsa' else: progress ("Checkout matches pristine darcs tree.") @@ -702,7 +703,12 @@ def main (): os.environ['GIT_DIR'] = git_repo - gfi = os.popen ('git-fast-import --quiet', 'w') + + quiet = ' --quiet' + if options.verbose: + quiet = ' ' + + gfi = os.popen ('git-fast-import %s' % quiet, 'w') patches = get_darcs_patches (darcs_repo) conv_repo = DarcsConversionRepo (options.basename + ".tmpdarcs", patches) @@ -770,7 +776,6 @@ def main (): export_pending (gfi) gfi.close () - for f in glob.glob ('%(git_repo)s/refs/heads/darcstmp*' % locals ()): os.unlink (f) -- 2.11.4.GIT