[PATCH 2 of 2] forget: don't report rejected files as forgotten as well

Martin von Zweigbergk martinvonz at google.com
Tue Jan 13 20:29:39 CST 2015


Looks like possible quadratic runtime. Can both rejected and forget be
large lists?

Not your fault, but do you think rejected and match.files() on the line
above can both be large?

On Tue, Jan 13, 2015, 18:11 Matt Harbison <mharbison72 at gmail.com> wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1421036723 18000
> #      Sun Jan 11 23:25:23 2015 -0500
> # Node ID 394c03620d245326b3fa8ac87e0c89c253df9cda
> # Parent  9e24ea4fa4d77dc77375467a1a8263d5d7e1f4d3
> forget: don't report rejected files as forgotten as well
>
> It seems like a mistake to report a file as forgotten and rejected.  The
> forgotten list doesn't seem to be used by anything in core, so no test
> changes.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -2057,7 +2057,7 @@
>
>      rejected = wctx.forget(forget, prefix)
>      bad.extend(f for f in rejected if f in match.files())
> -    forgot.extend(forget)
> +    forgot.extend(f for f in forget if f not in rejected)
>      return bad, forgot
>
>  def remove(ui, repo, m, prefix, after, force, subrepos):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150114/e425fd06/attachment.html>


More information about the Mercurial-devel mailing list