D2934: forget: add --confirm option

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Thu Mar 22 12:39:27 EDT 2018


pulkit requested changes to this revision.
pulkit added inline comments.

INLINE COMMENTS

> cmdutil.py:2051
>  
> +    if confirm:
> +        if ui.promptchoice(_('are you sure you want to forget (yn)?'

This should be before "removing <filename>" message. Also this message should also show filename, something like "forget <filenames> (yn)?"

> cmdutil.py:2054
> +                             '$$ &Yes $$ &No')):
> +            raise error.Abort(_('forget canceled'))
> +

I am not sure what are you trying do here. Can you look again?

> commands.py:2079
>      m = scmutil.match(repo[None], pats, opts)
> -    dryrun = opts.get(r'dry_run')
> +    dryrun, confirm = opts.get(r'dry_run'), opts.get(r'confirm')
>      rejected = cmdutil.forget(ui, repo, m, prefix="",

We don't need r'' prefix here. You can drop one before 'dry_run' too.

> test-add.t:290
> +  are you sure you want to forget (yn)? y
> +  $ hg diff
> +  diff -r e63c23eaa88a foo

In such cases, `hg status` will be a better option.

> test-add.t:302
> +  removing foo
> +  are you sure you want to forget (yn)? y
> +  $ cd ..

Looks like it's not reading the input. Look whether ui.interactive is set or not.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2934

To: khanchi97, #hg-reviewers, av6, pulkit
Cc: pulkit, av6, mercurial-devel


More information about the Mercurial-devel mailing list