( )⚙ D3829 rebase: make dry-run return 1 or 0 according to result

This is an archive of the discontinued Mercurial Phabricator instance.

rebase: make dry-run return 1 or 0 according to result
ClosedPublic

Authored by khanchi97 on Jun 22 2018, 11:30 PM.

Details

Summary

In dry-run mode, if there is no conflict return 0, if any then return 1

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

khanchi97 created this revision.Jun 22 2018, 11:30 PM
yuja added a subscriber: yuja.Jun 23 2018, 11:12 PM
  • a/hgext/rebase.py

+++ b/hgext/rebase.py
@@ -825,10 +825,13 @@

                    **opts)
except error.InMemoryMergeConflictsError:
    ui.status(_('hit a merge conflict\n'))

+ retcode = 1

else:

+ retcode = 0

    ui.status(_('there will be no conflict, you can rebase\n'))
finally:
    _origrebase(ui, repo, abort=True)

+ return retcode

retcode may be undefined depending on the error type occurred in
_origrebase(). Instead, you can simply return 1 and 0 in the except
and else clauses respectively.

khanchi97 updated this revision to Diff 9270.Jun 24 2018, 6:31 AM
pulkit accepted this revision.Jun 24 2018, 12:30 PM
This revision was automatically updated to reflect the committed changes.