Added logic to find those csets whose phase will be changed (when
running without --dryrun) while advancing boundary and return those csets.
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG36ba5dba372d: advanceboundary: add dryrun parameter
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Thanks for breaking this up. I have some put comments which are mostly doubts, can you explain by replying to them why you did so?
mercurial/phases.py | ||
---|---|---|
369 | why are we maintaining this rejected list? | |
370 | can you explain what this changes list means? | |
371 | This conditional looks unnecessary unless I am mistaken. Can you explain why we need this? | |
404 | We can prevent this else by returning the values early. | |
500 | We should add documentation about the new dryrun argument and the new return values. |
mercurial/phases.py | ||
---|---|---|
369 | rejected list will contain those csets which will be rejected during advancing boundary and then return this list so that we can report for rejected csets during dry_run of phase command. | |
370 | yeah, this list is for storing sets of changed csets, ordered from minimum phase to maximum phase. | |
371 | I thought we would calculate rejected only when we are in dryrun mode. | |
404 | yeah, I will make this change. | |
500 | okay, I will do this in other patches too. |
mercurial/phases.py | ||
---|---|---|
371 | okay its fine. I will remove this unnecessary condition. Because I think rejected value can also be used in phase method of mercurial/commands.py even when we are not in dryrun. | |
403 | I think I can add continue here and prevent else from next block. | |
404 | But we are returning values after 'for loop' ends. As I am updating changes data in each iteration of loop. |
Nice work! Returning a set of changesets whose phase is changed or can be changed is a better API than returning a rejected list and a list of sets.
mercurial/phases.py | ||
---|---|---|
358 | Add docs about dryrun and return value here too. | |
392 | We should populate the changes set and return that even if we are performing actions. | |
509 | The return value should be set of revisions who phase is changed or can be changed irrespective of whether dry-run is passed or not. |
Also, can you add about why we are adding a dryrun parameter to functions here and what will be the behavior in the commit message too?
mercurial/phases.py | ||
---|---|---|
520 | Fixed this indentation to align with opening brackets in flight. |
Add docs about dryrun and return value here too.