comparison hgsubversion/svncommands.py @ 1601:5d8603f080c5

compathacks: add compat code for ui.makeprogress() deprecation ui.makeprogress() is deprecated and will be dropped in 5.1. This patch adds compat code for that. The compat code is plain copy of compat code available in evolve extension.
author Pulkit Goyal <pulkit@yandex-team.ru>
date Mon, 04 Feb 2019 20:56:39 +0300
parents 51e105c7f0c6
children
comparison
equal deleted inserted replaced
1600:6f5b296c01dd 1601:5d8603f080c5
106 # ctx.children() visits all revisions in the repository after ctx. Calling 106 # ctx.children() visits all revisions in the repository after ctx. Calling
107 # it would make us use O(revisions^2) time, so we perform an extra traversal 107 # it would make us use O(revisions^2) time, so we perform an extra traversal
108 # of the repository instead. During this traversal, we find all converted 108 # of the repository instead. During this traversal, we find all converted
109 # changesets that close a branch, and store their first parent 109 # changesets that close a branch, and store their first parent
110 for ctx in util.get_contexts(repo, startrev): 110 for ctx in util.get_contexts(repo, startrev):
111 ui.progress('prepare', ctx.rev() - startrev, total=numrevs) 111 compathacks.progress(ui, 'prepare', ctx.rev() - startrev, total=numrevs)
112 112
113 convinfo = util.getsvnrev(ctx, None) 113 convinfo = util.getsvnrev(ctx, None)
114 if not convinfo: 114 if not convinfo:
115 continue 115 continue
116 svnrevnum = int(convinfo.rsplit('@', 1)[1]) 116 svnrevnum = int(convinfo.rsplit('@', 1)[1])
130 parentbranch = None 130 parentbranch = None
131 branchinfo.pop(parentbranch) 131 branchinfo.pop(parentbranch)
132 else: 132 else:
133 closed.add(parentctx.rev()) 133 closed.add(parentctx.rev())
134 134
135 ui.progress('prepare', None, total=numrevs) 135 compathacks.progress(ui, 'prepare', None, total=numrevs)
136 136
137 revmapbuf = [] 137 revmapbuf = []
138 for ctx in util.get_contexts(repo, startrev): 138 for ctx in util.get_contexts(repo, startrev):
139 ui.progress('rebuild', ctx.rev() - startrev, total=numrevs) 139 compathacks.progress(ui, 'rebuild', ctx.rev() - startrev, total=numrevs)
140 140
141 convinfo = util.getsvnrev(ctx, None) 141 convinfo = util.getsvnrev(ctx, None)
142 if not convinfo: 142 if not convinfo:
143 continue 143 continue
144 if '.hgtags' in ctx.files(): 144 if '.hgtags' in ctx.files():
265 branchinfo[branch] = (parentbranch, 265 branchinfo[branch] = (parentbranch,
266 int(parentrev), 266 int(parentrev),
267 revision) 267 revision)
268 268
269 revmap.batchset(revmapbuf, youngest) 269 revmap.batchset(revmapbuf, youngest)
270 ui.progress('rebuild', None, total=numrevs) 270 compathacks.progress(ui, 'rebuild', None, total=numrevs)
271 271
272 # save off branch info 272 # save off branch info
273 util.dump(branchinfo, meta.branch_info_file) 273 util.dump(branchinfo, meta.branch_info_file)
274 274
275 275