Improved output when in dryrun, for user to make sure that
no change will be written to repository.
Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG731debab233f: rebase: improve output of --dry-run
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Thinking out loud here: I see that --dry-run for rebase will be very useful for automation. How about returning 1 when there are conflicts and returning 0 when there are no conflicts? Also maybe we should add formatter support to the dry-run output for each command so that automation can read the JSON output and tell user what can happen.
Comment Actions
I approve of both of these feature suggestions! However, they should be implemented in standalone changesets and not incorporated into this one.
Comment Actions
okay @pulkit , let me confirm if IIUC your points.
- First thing is we would have a function which will accept a return_code(0 or 1) and output_data (what can happen without --dry-run) from any command (which has dry-run functionality). And will give output to the user according to the return_code. Following is the rough code for this, correct me if I am wrong at any point.
def dryrunformatter(retcode, **outputdata): ui.status(_("starting dry-run; repository will not be changed")) # here show the outputdata accordingly if retcode == 0: ui.status(_("dry-run completed successfully; run without --dry-run/-n to perform this action")) else: ui.status(_("hit conflicts!"))
- If above explanation is right, talking about "additional functionality in dryrun" like --verbose mode in rebase which @indygreg suggested. May be we can add this type of functionality too in dryrunformatter? What do you say?
Comment Actions
@khanchi97 you should have created a new differential so that we don't loose your earlier patch titled: 'rebase: improve output of --dry-run' which is yet under review.