##// END OF EJS Templates
incoming/outgoing: Fix recursion on sub repositories...
Erik Zielke -
r12400:40852b4b default
parent child Browse files
Show More
@@ -2363,11 +2363,6 b' def incoming(ui, repo, source="default",'
2363 2363 raise util.Abort(_('cannot combine --bundle and --subrepos'))
2364 2364
2365 2365 ret = hg.incoming(ui, repo, source, opts)
2366 if opts.get('subrepos'):
2367 ctx = repo[None]
2368 for subpath in sorted(ctx.substate):
2369 sub = ctx.sub(subpath)
2370 ret = min(ret, sub.incoming(ui, source, opts))
2371 2366 return ret
2372 2367
2373 2368 def init(ui, dest=".", **opts):
@@ -2630,11 +2625,6 b' def outgoing(ui, repo, dest=None, **opts'
2630 2625 Returns 0 if there are outgoing changes, 1 otherwise.
2631 2626 """
2632 2627 ret = hg.outgoing(ui, repo, dest, opts)
2633 if opts.get('subrepos'):
2634 ctx = repo[None]
2635 for subpath in sorted(ctx.substate):
2636 sub = ctx.sub(subpath)
2637 ret = min(ret, sub.outgoing(ui, dest, opts))
2638 2628 return ret
2639 2629
2640 2630 def parents(ui, repo, file_=None, **opts):
@@ -409,6 +409,15 b' def merge(repo, node, force=None, remind'
409 409 return stats[3] > 0
410 410
411 411 def incoming(ui, repo, source, opts):
412 def recurse():
413 ret = 1
414 if opts.get('subrepos'):
415 ctx = repo[None]
416 for subpath in sorted(ctx.substate):
417 sub = ctx.sub(subpath)
418 ret = min(ret, sub.incoming(ui, source, opts))
419 return ret
420
412 421 limit = cmdutil.loglimit(opts)
413 422 source, branches = parseurl(ui.expandpath(source), opts.get('branch'))
414 423 other = repository(remoteui(repo, opts), source)
@@ -426,7 +435,7 b' def incoming(ui, repo, source, opts):'
426 435 except:
427 436 pass
428 437 ui.status(_("no changes found\n"))
429 return 1
438 return recurse()
430 439
431 440 cleanup = None
432 441 try:
@@ -469,8 +478,19 b' def incoming(ui, repo, source, opts):'
469 478 other.close()
470 479 if cleanup:
471 480 os.unlink(cleanup)
481 recurse()
482 return 0 # exit code is zero since we found incoming changes
472 483
473 484 def outgoing(ui, repo, dest, opts):
485 def recurse():
486 ret = 1
487 if opts.get('subrepos'):
488 ctx = repo[None]
489 for subpath in sorted(ctx.substate):
490 sub = ctx.sub(subpath)
491 ret = min(ret, sub.outgoing(ui, dest, opts))
492 return ret
493
474 494 limit = cmdutil.loglimit(opts)
475 495 dest = ui.expandpath(dest or 'default-push', dest or 'default')
476 496 dest, branches = parseurl(dest, opts.get('branch'))
@@ -483,7 +503,8 b' def outgoing(ui, repo, dest, opts):'
483 503 o = discovery.findoutgoing(repo, other, force=opts.get('force'))
484 504 if not o:
485 505 ui.status(_("no changes found\n"))
486 return 1
506 return recurse()
507
487 508 o = repo.changelog.nodesbetween(o, revs)[0]
488 509 if opts.get('newest_first'):
489 510 o.reverse()
@@ -498,6 +519,8 b' def outgoing(ui, repo, dest, opts):'
498 519 count += 1
499 520 displayer.show(repo[n])
500 521 displayer.close()
522 recurse()
523 return 0 # exit code is zero since we found outgoing changes
501 524
502 525 def revert(repo, node, choose):
503 526 """revert changes to revision in node without updating dirstate"""
@@ -273,6 +273,9 b' Clone and test outgoing:'
273 273 comparing with */test-subrepo-recursion.t/repo/foo (glob)
274 274 searching for changes
275 275 no changes found
276 comparing with */test-subrepo-recursion.t/repo/foo/bar (glob)
277 searching for changes
278 no changes found
276 279 [1]
277 280
278 281 Make nested change:
@@ -306,6 +309,9 b' Make nested change:'
306 309 date: Thu Jan 01 00:00:00 1970 +0000
307 310 summary: 3-4-2
308 311
312 comparing with */test-subrepo-recursion.t/repo/foo/bar (glob)
313 searching for changes
314 no changes found
309 315
310 316 Switch to original repo and setup default path:
311 317
@@ -332,6 +338,10 b' Test incoming:'
332 338 date: Thu Jan 01 00:00:00 1970 +0000
333 339 summary: 3-4-2
334 340
341 comparing with */test-subrepo-recursion.t/repo2/foo/bar (glob)
342 searching for changes
343 no changes found
344
335 345 $ hg incoming -S --bundle incoming.hg
336 346 abort: cannot combine --bundle and --subrepos
337 347 [255]
General Comments 0
You need to be logged in to leave comments. Login now