From af3810ae2fd882cf841a0c6178c9e6e0eaa52164 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Sat, 10 Mar 2007 14:28:45 +0000 Subject: [PATCH] Only attempt to verify heads hg has, too In the git repo there may be any number branches that are not hg imported branches, so it doesn't make sense to print warnings when a non-hg head isn't at what it was last time. Now we get a list of branchtags hg has and only verify these. Signed-off-by: Rocco Rutte --- hg2git.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hg2git.py b/hg2git.py index e328a42..129272a 100644 --- a/hg2git.py +++ b/hg2git.py @@ -57,11 +57,12 @@ def fixup_user(user,authors): name=m2.group(1) return '%s %s' % (name,mail) +def get_branch(name): + if name=='HEAD': + name=cfg_master + return name + def get_changeset(ui,repo,revision,authors): - def get_branch(name): - if name=='HEAD': - name=cfg_master - return name node=repo.lookup(revision) (manifest,user,(time,timezone),files,desc,extra)=repo.changelog.read(node) tz="%+03d%02d" % (-timezone / 3600, ((-timezone % 3600) / 60)) @@ -290,7 +291,13 @@ def verify_heads(ui,repo,cache): f.close() return sha1 - for b in cache.keys(): + # get list of hg's branches to verify, don't take all git has + branches=repo.branchtags() + l=[(-repo.changelog.rev(n), n, t) for t, n in branches.items()] + l.sort() + + for _,_,b in l: + b=get_branch(b) sys.stderr.write('Verifying branch [%s]\n' % b) sha1=getsha1(b) c=cache.get(b) -- 2.11.0