##// END OF EJS Templates
outgoing: move filtering logic in its own function...
marmoute -
r47676:50b79f8b default
parent child Browse files
Show More
@@ -1358,27 +1358,40 b' def _outgoing_recurse(ui, repo, dest, op'
1358 1358 return ret
1359 1359
1360 1360
1361 def _outgoing_filter(repo, revs, opts):
1362 """apply revision filtering/ordering option for outgoing"""
1363 limit = logcmdutil.getlimit(opts)
1364 no_merges = opts.get(b'no_merges')
1365 if opts.get(b'newest_first'):
1366 revs.reverse()
1367 if limit is None and not no_merges:
1368 for r in revs:
1369 yield r
1370 return
1371
1372 count = 0
1373 cl = repo.changelog
1374 for n in revs:
1375 if limit is not None and count >= limit:
1376 break
1377 parents = [p for p in cl.parents(n) if p != nullid]
1378 if no_merges and len(parents) == 2:
1379 continue
1380 count += 1
1381 yield n
1382
1383
1361 1384 def outgoing(ui, repo, dest, opts):
1362 1385
1363 limit = logcmdutil.getlimit(opts)
1364 1386 o, other = _outgoing(ui, repo, dest, opts)
1365 1387 ret = 1
1366 1388 try:
1367 1389 if o:
1368 1390 ret = 0
1369 1391
1370 if opts.get(b'newest_first'):
1371 o.reverse()
1372 1392 ui.pager(b'outgoing')
1373 1393 displayer = logcmdutil.changesetdisplayer(ui, repo, opts)
1374 count = 0
1375 for n in o:
1376 if limit is not None and count >= limit:
1377 break
1378 parents = [p for p in repo.changelog.parents(n) if p != nullid]
1379 if opts.get(b'no_merges') and len(parents) == 2:
1380 continue
1381 count += 1
1394 for n in _outgoing_filter(repo, o, opts):
1382 1395 displayer.show(repo[n])
1383 1396 displayer.close()
1384 1397 cmdutil.outgoinghooks(ui, repo, other, opts, o)
General Comments 0
You need to be logged in to leave comments. Login now