##// END OF EJS Templates
debugdiscovery: migrate `opts` to native kwargs
Matt Harbison -
r51842:8e508359 default
parent child Browse files
Show More
@@ -1234,22 +1234,21 b' def debugdiscovery(ui, repo, remoteurl=b'
1234
1234
1235 Control the initial size of the discovery for initial change
1235 Control the initial size of the discovery for initial change
1236 """
1236 """
1237 opts = pycompat.byteskwargs(opts)
1238 unfi = repo.unfiltered()
1237 unfi = repo.unfiltered()
1239
1238
1240 # setup potential extra filtering
1239 # setup potential extra filtering
1241 local_revs = opts[b"local_as_revs"]
1240 local_revs = opts["local_as_revs"]
1242 remote_revs = opts[b"remote_as_revs"]
1241 remote_revs = opts["remote_as_revs"]
1243
1242
1244 # make sure tests are repeatable
1243 # make sure tests are repeatable
1245 random.seed(int(opts[b'seed']))
1244 random.seed(int(opts['seed']))
1246
1245
1247 if not remote_revs:
1246 if not remote_revs:
1248 path = urlutil.get_unique_pull_path_obj(
1247 path = urlutil.get_unique_pull_path_obj(
1249 b'debugdiscovery', ui, remoteurl
1248 b'debugdiscovery', ui, remoteurl
1250 )
1249 )
1251 branches = (path.branch, [])
1250 branches = (path.branch, [])
1252 remote = hg.peer(repo, opts, path)
1251 remote = hg.peer(repo, pycompat.byteskwargs(opts), path)
1253 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(path.loc))
1252 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(path.loc))
1254 else:
1253 else:
1255 branches = (None, [])
1254 branches = (None, [])
@@ -1279,7 +1278,7 b' def debugdiscovery(ui, repo, remoteurl=b'
1279 repo = repo.filtered(b'debug-discovery-local-filter')
1278 repo = repo.filtered(b'debug-discovery-local-filter')
1280
1279
1281 data = {}
1280 data = {}
1282 if opts.get(b'old'):
1281 if opts.get('old'):
1283
1282
1284 def doit(pushedrevs, remoteheads, remote=remote):
1283 def doit(pushedrevs, remoteheads, remote=remote):
1285 if not hasattr(remote, 'branches'):
1284 if not hasattr(remote, 'branches'):
@@ -1292,7 +1291,7 b' def debugdiscovery(ui, repo, remoteurl=b'
1292 repo, remote, force=True, audit=data
1291 repo, remote, force=True, audit=data
1293 )
1292 )
1294 common = set(common)
1293 common = set(common)
1295 if not opts.get(b'nonheads'):
1294 if not opts.get('nonheads'):
1296 ui.writenoi18n(
1295 ui.writenoi18n(
1297 b"unpruned common: %s\n"
1296 b"unpruned common: %s\n"
1298 % b" ".join(sorted(short(n) for n in common))
1297 % b" ".join(sorted(short(n) for n in common))
@@ -1321,9 +1320,9 b' def debugdiscovery(ui, repo, remoteurl=b'
1321 return common, hds
1320 return common, hds
1322
1321
1323 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None)
1322 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None)
1324 localrevs = opts[b'rev']
1323 localrevs = opts['rev']
1325
1324
1326 fm = ui.formatter(b'debugdiscovery', opts)
1325 fm = ui.formatter(b'debugdiscovery', pycompat.byteskwargs(opts))
1327 if fm.strict_format:
1326 if fm.strict_format:
1328
1327
1329 @contextlib.contextmanager
1328 @contextlib.contextmanager
General Comments 0
You need to be logged in to leave comments. Login now