comparison 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
comparison
equal deleted inserted replaced
214:1416429584b2 215:b5ef9a404f5d
83 lastrevfile.write(str(last_rev)) 83 lastrevfile.write(str(last_rev))
84 lastrevfile.close() 84 lastrevfile.close()
85 branchinfofile = open(os.path.join(svnmetadir, 'branch_info'), 'w') 85 branchinfofile = open(os.path.join(svnmetadir, 'branch_info'), 'w')
86 pickle.dump(branchinfo, branchinfofile) 86 pickle.dump(branchinfo, branchinfofile)
87 branchinfofile.close() 87 branchinfofile.close()
88
89 # now handle tags
88 tagsinfo = {} 90 tagsinfo = {}
89 realtags = svn.tags 91 realtags = svn.tags
90 tagsleft = realtags.items() 92 tagsleft = realtags.items()
91 while tagsleft: 93 while tagsleft:
92 tag, tagparent = tagsleft.pop(0) 94 tag, tagparent = tagsleft.pop(0)
101 tagsleft.append(src) 103 tagsleft.append(src)
102 else: 104 else:
103 older_tags = svn.tags_at_rev(rev) 105 older_tags = svn.tags_at_rev(rev)
104 newsrc, newrev = older_tags[src] 106 newsrc, newrev = older_tags[src]
105 tagsleft.append((tag, (newsrc, newrev))) 107 tagsleft.append((tag, (newsrc, newrev)))
106 if source.startswith('branches/') or source == 'trunk': 108 continue
109 else:
107 source = determinebranch(source) 110 source = determinebranch(source)
108 if rev <= last_rev: 111 if rev <= last_rev:
109 tagsinfo[tag] = source, rev 112 tagsinfo[tag] = source, rev
110 tagsinfofile = open(os.path.join(svnmetadir, 'tag_info'), 'w') 113 tagsinfofile = open(os.path.join(svnmetadir, 'tag_info'), 'w')
111 pickle.dump(tagsinfo, tagsinfofile) 114 pickle.dump(tagsinfo, tagsinfofile)
112 tagsinfofile.close() 115 tagsinfofile.close()
113 rebuildmeta = util.register_subcommand('rebuildmeta')(rebuildmeta) 116 rebuildmeta = util.register_subcommand('rebuildmeta')(rebuildmeta)
114 rebuildmeta = util.command_needs_no_url(rebuildmeta) 117 rebuildmeta = util.command_needs_no_url(rebuildmeta)
115 118
116 def determinebranch(branch): 119 def determinebranch(branch):
117 if branch.startswith('branches'): 120 assert not branch.startswith('tags/'), "Tags can't be tags of other tags."
121 if branch.startswith('branches/'):
118 branch = branch[len('branches/'):] 122 branch = branch[len('branches/'):]
119 elif branch == 'trunk': 123 elif branch == 'trunk':
120 branch = None 124 branch = None
121 else: 125 else:
122 assert False, 'Unhandled case while regenerating metadata.' 126 branch = '../' + branch
123 return branch 127 return branch