Also added confirmopts in cmdutil.py
Details
- Reviewers
av6 pulkit durin42 - Group Reviewers
hg-reviewers - Commits
- rHGe7bf5a73e4e1: forget: add --confirm option
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
mercurial/cmdutil.py | ||
---|---|---|
2057 | This should be before "removing <filename>" message. Also this message should also show filename, something like "forget <filenames> (yn)?" | |
2060 | I am not sure what are you trying do here. Can you look again? | |
mercurial/commands.py | ||
2079 | We don't need r'' prefix here. You can drop one before 'dry_run' too. | |
tests/test-add.t | ||
290 | In such cases, hg status will be a better option. | |
302 | Looks like it's not reading the input. Look whether ui.interactive is set or not. |
mercurial/cmdutil.py | ||
---|---|---|
2047 | I think the right behavior should be to ask for each file and forget the ones which user confirmed to forget. | |
tests/test-add.t | ||
293 | This is not reading 'n' as an input here and rather going for the default value. You should set ui.interactive to True. | |
300 | Please add more tests involving multiple files at once. |
I agree with you here that this command is simple. I think @khanchi97 is picking easy and simple ones to start with.
mercurial/cmdutil.py | ||
---|---|---|
2047 | +1 to the prompt per file. And maybe options for 'all'/'none' to apply to the rest of the files that haven't been processed? Maybe look at --interactive on commit or similar for naming on that. |
I have made the requested changes. Now --confirm will prompt per file and also added all/skip option which will either include all the remaining files or skip all the remaining files according the user input.
mercurial/cmdutil.py | ||
---|---|---|
2007 | sorry, am I supposed to make any change here? | |
2047 | cool :) | |
mercurial/commands.py | ||
2043 | yeah, I will update this. | |
tests/test-add.t | ||
296 | I have set ui.interactive=True but it still not read input. | |
302 | I need some help here. Why it's not passing n as a response? I passed n in line 299 but as a response from user why it is taking y everytime? | |
302 | I have set ui.interactive=True but, the problem is still same. And also by default ui.interactive is always True. |
I've touched this up in-flight and will land it, thanks.
(Suggestion: diff the output of hg export on your version vs the one that lands to see what I needed to tweak - there were some oversights in tests during development it looks like.)
Alternately if you have the extdiff extension configured, you can diff the two revisions directly and supply --patch to the extdiff command get the same effect. I think it's easier to view graphically, than a diff of a diff.
The change looks good, but new behavior sounds more like --interactive
than --confirm.
I'm fine to rename this to --interactive if we think that makes more sense, even if we do it during the freeze.
"cannot specify both --dry-run and --confirm" is the style used in other commands.