Mercurial > hgsubversion
diff rebuildmeta.py @ 215:b5ef9a404f5d
Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Fixed a bunch of tests as a result. This likely will make new conversions of some repos have new revisions in them.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 27 Mar 2009 16:56:07 -0500 |
parents | 30df375590d1 |
children | a360ddc97719 |
line wrap: on
line diff
--- a/rebuildmeta.py +++ b/rebuildmeta.py @@ -85,6 +85,8 @@ def rebuildmeta(ui, repo, hg_repo_path, branchinfofile = open(os.path.join(svnmetadir, 'branch_info'), 'w') pickle.dump(branchinfo, branchinfofile) branchinfofile.close() + + # now handle tags tagsinfo = {} realtags = svn.tags tagsleft = realtags.items() @@ -103,10 +105,11 @@ def rebuildmeta(ui, repo, hg_repo_path, older_tags = svn.tags_at_rev(rev) newsrc, newrev = older_tags[src] tagsleft.append((tag, (newsrc, newrev))) - if source.startswith('branches/') or source == 'trunk': + continue + else: source = determinebranch(source) - if rev <= last_rev: - tagsinfo[tag] = source, rev + if rev <= last_rev: + tagsinfo[tag] = source, rev tagsinfofile = open(os.path.join(svnmetadir, 'tag_info'), 'w') pickle.dump(tagsinfo, tagsinfofile) tagsinfofile.close() @@ -114,10 +117,11 @@ rebuildmeta = util.register_subcommand(' rebuildmeta = util.command_needs_no_url(rebuildmeta) def determinebranch(branch): - if branch.startswith('branches'): + assert not branch.startswith('tags/'), "Tags can't be tags of other tags." + if branch.startswith('branches/'): branch = branch[len('branches/'):] elif branch == 'trunk': branch = None else: - assert False, 'Unhandled case while regenerating metadata.' + branch = '../' + branch return branch