Mercurial > evolve
comparison hgext3rd/topic/discovery.py @ 4742:db3e7f6b5ceb
py3: switch from iteritems() to items() in the topics extension
The only remaining iteritems() call is on branchmap. That will be
dealt with in the next patch.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 12 Jul 2019 23:24:04 -0700 |
parents | 75b414b298f5 |
children | 92e3db149d7d |
comparison
equal
deleted
inserted
replaced
4741:e8727a27e380 | 4742:db3e7f6b5ceb |
---|---|
108 remote.branchmap = remotebranchmap | 108 remote.branchmap = remotebranchmap |
109 unxx = repo.filtered('unfiltered-topic') | 109 unxx = repo.filtered('unfiltered-topic') |
110 repo.unfiltered = lambda: unxx | 110 repo.unfiltered = lambda: unxx |
111 pushop.repo = repo | 111 pushop.repo = repo |
112 summary = orig(pushop) | 112 summary = orig(pushop) |
113 for key, value in summary.iteritems(): | 113 for key, value in summary.items(): |
114 if ':' in key: # This is a topic | 114 if ':' in key: # This is a topic |
115 if value[0] is None and value[1]: | 115 if value[0] is None and value[1]: |
116 summary[key] = ([value[1][0]], ) + value[1:] | 116 summary[key] = ([value[1][0]], ) + value[1:] |
117 return summary | 117 return summary |
118 finally: | 118 finally: |
169 def validator(tr): | 169 def validator(tr): |
170 repo = reporef() | 170 repo = reporef() |
171 if repo is not None: | 171 if repo is not None: |
172 repo.invalidatecaches() | 172 repo.invalidatecaches() |
173 finalheads = _nbheads(repo) | 173 finalheads = _nbheads(repo) |
174 for branch, oldnb in tr._prepushheads.iteritems(): | 174 for branch, oldnb in tr._prepushheads.items(): |
175 newnb = finalheads.pop(branch, 0) | 175 newnb = finalheads.pop(branch, 0) |
176 if oldnb < newnb: | 176 if oldnb < newnb: |
177 msg = _('push create a new head on branch "%s"' % branch) | 177 msg = _('push create a new head on branch "%s"' % branch) |
178 raise error.Abort(msg) | 178 raise error.Abort(msg) |
179 for branch, newnb in finalheads.iteritems(): | 179 for branch, newnb in finalheads.items(): |
180 if 1 < newnb: | 180 if 1 < newnb: |
181 msg = _('push create more than 1 head on new branch "%s"' | 181 msg = _('push create more than 1 head on new branch "%s"' |
182 % branch) | 182 % branch) |
183 raise error.Abort(msg) | 183 raise error.Abort(msg) |
184 return oldvalidator(tr) | 184 return oldvalidator(tr) |