# HG changeset patch # User Kyle Lippincott # Date 1522353665 25200 # Node ID 4fcf815916f5ea07f6fe27b935ff449715e06cc1 # Parent ca9fd36b45282fa8a8172f650635eb8b8242f9b0 evolve: do not exit 1 when there are no troubled changesets (issue5823) There are possibly other cases we also do not wish to exit non-zero for in this function, but I did not analyze them closely and am just looking at resolving issue5823. diff -r ca9fd36b4528 -r 4fcf815916f5 CHANGELOG --- a/CHANGELOG Fri Apr 06 17:54:58 2018 +0200 +++ b/CHANGELOG Thu Mar 29 13:01:05 2018 -0700 @@ -6,6 +6,7 @@ * drop support for Mercurial 4.1 * `--obsolete` and `--old-obsolete` flags for `hg graft` are dropped + * `hg evolve` now return 0 if there is nothing to evolve * fixed some memory leak issue diff -r ca9fd36b4528 -r 4fcf815916f5 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Fri Apr 06 17:54:58 2018 +0200 +++ b/hgext3rd/evolve/evolvecmd.py Thu Mar 29 13:01:05 2018 -0700 @@ -749,6 +749,7 @@ unselectedcategories = [c for c in troublecategories if c != targetcat] msg = None hint = None + retoverride = None troubled = { "orphan": repo.revs("orphan()"), @@ -835,14 +836,20 @@ hint = hintmap['any+' + ('+'.join(othertroubles))] else: msg = _("no troubled changesets") + # Exit with a 0 (success) status in this case. + retoverride = 0 assert msg is not None ui.write_err("%s\n" % msg) if hint: ui.write_err("(%s)\n" % hint) - return 2 + ret = 2 else: - return 1 + ret = 1 + + if retoverride is not None: + return retoverride + return ret def _preparelistctxs(items, condition): return [item.hex() for item in items if condition(item)] diff -r ca9fd36b4528 -r 4fcf815916f5 tests/test-stabilize-order.t --- a/tests/test-stabilize-order.t Fri Apr 06 17:54:58 2018 +0200 +++ b/tests/test-stabilize-order.t Thu Mar 29 13:01:05 2018 -0700 @@ -129,7 +129,6 @@ $ hg evolve -v no troubled changesets - [1] Test behavior with --any