From b702707afc942914f446dab8bb7eaa3d5a47e09c Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Tue, 6 Mar 2007 19:47:51 +0000 Subject: [PATCH] Provide two versions of getting changes per manifest As suggested on #mercurial, filectxs() may be faster than calling filectx() per file. --- hg2git.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hg2git.py b/hg2git.py index 0bbbe03..076a80e 100644 --- a/hg2git.py +++ b/hg2git.py @@ -119,13 +119,21 @@ def export_commit(ui,repo,revision,marks,heads,last,max,count): last[branch]=revision heads[branch]='' + # just wipe the branch clean, all full manifest contents + wr('deleteall') + ctx=repo.changectx(str(revision)) man=ctx.manifest() - wr('deleteall') + #for f in man.keys(): + # fctx=ctx.filectx(f) + # d=fctx.data() + # wr('M %s inline %s' % (gitmode(man.execf(f)),f)) + # wr('data %d' % len(d)) # had some trouble with size() + # wr(d) - for f in man.keys(): - fctx=ctx.filectx(f) + for fctx in ctx.filectxs(): + f=fctx.path() d=fctx.data() wr('M %s inline %s' % (gitmode(man.execf(f)),f)) wr('data %d' % len(d)) # had some trouble with size() -- 2.11.4.GIT