phase: add dry-run functionality
Needs ReviewPublic

Authored by khanchi97 on Apr 7 2018, 7:33 AM.

Details

Reviewers
pulkit
Group Reviewers
hg-reviewers
Summary

Added the logic to find those csets whose phase will be changed
(while running without --dry-run). And show the list of those csets.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped
khanchi97 created this revision.Apr 7 2018, 7:33 AM
khanchi97 updated this revision to Diff 7874.Apr 7 2018, 7:42 AM
khanchi97 retitled this revision from phase: Add dry-run functionality to phase: add dry-run functionality.
av6 added a subscriber: av6.Apr 8 2018, 1:57 AM
av6 added inline comments.
mercurial/commands.py
3943

"cannot use --dry-run without target phase"

khanchi97 updated this revision to Diff 7877.Apr 8 2018, 7:00 AM

@pulkit Can you please review it?

pulkit added inline comments.May 20 2018, 3:36 PM
mercurial/commands.py
3962

Since all the logic is copy-pasted from phases.advanceboundary and phases.retractboundary, why not we just pass the --dry-run option there and get the count from those functions only.

tests/test-phases.t
990

This is not very much helpful. In such cases, how about showing the range of changesets, something like:

f7b1eb17ad24::925d80f479bb public -> draft
b385d13d5ed4::fdc0253c25cf secret -> draft

okay, but I have some queries like

  1. How about showing revision no. instead of cset id?
  2. And in this https://pastebin.com/raw/kWcr9xVK example if I change revision 2 phase to --secret then how it should print the range, I mean now we have branches in this range?

Can we show that range like this:

0316ce92851d : : b385d13d5ed4 draft -> secret
0316ce92851d : : 4ccc844d5454 draft -> secret

okay, but I have some queries like

  1. How about showing revision no. instead of cset id?

I think we should show cset ids. If you want to with rev numbers, go with that. This should not be a blocker to get the initial patch in.

  1. And in this https://pastebin.com/raw/kWcr9xVK example if I change revision 2 phase to --secret then how it should print the range, I mean now we have branches in this range?

    Can we show that range like this:

    0316ce92851d : : b385d13d5ed4 draft -> secret 0316ce92851d : : 4ccc844d5454 draft -> secret

There are two ways you can show the range in this case:

  1. 0316ce92851d::b385d13d5ed4 and f19b7f89f44e::4ccc844d5454
  2. 0316ce92851d::4ccc844d5454 and b385d13d5ed4

Look into hg help revsets to understand what :: means.

khanchi97 updated this revision to Diff 8896.May 25 2018, 4:33 PM
khanchi97 edited the summary of this revision. (Show Details)

@pulkit Now I moved the logic for finding revs (those phase will change) to advanceboundry and retractboundry function and for now it shows all nodes. I am working to show range instead. Take a look at this when you are free :)

Nice work! I like where how you simplified things from previous version.

If you look at the patch, this seems to do multiple things at once which are:

  • adding dry-run argument to advanceboundary and retractboundary functions
  • adding a new --dry-run flag to hg phase

Let's break things up in individual patches so that we can improve more on individual pieces. Can you split this into a separate patch for adding dryrun argument to each function, i.e. one patch for adcanceboundary, one for retractboundary, and then one last patch which adds the new flag? That will be very much helpful in reviewing this work and also making incremental changes and moving forward step by step.

khanchi97 updated this revision to Diff 8962.Jun 3 2018, 10:47 AM
khanchi97 edited the summary of this revision. (Show Details)