D7705: phases: make the working directory consistently a draft

Yuya Nishihara yuya at tcha.org
Thu Jan 9 08:51:45 EST 2020


> @@ -252,25 +254,44 @@
>                  revs = set.union(*[self._phasesets[p] for p in phases])
>              if repo.changelog.filteredrevs:
>                  revs = revs - repo.changelog.filteredrevs
> +
>              if subset is None:
>                  return smartset.baseset(revs)
>              else:
> +                if wdirrev in subset and repo[None].phase() in phases:
> +                    # The working dir would never be in the cache, but it was
> +                    # in the subset being filtered for its phase, so add it to
> +                    # the output.
> +                    revs.add(wdirrev)

Suppose `self._phasesets[]` is a read-only object in this method,
I think `revs` shouldn't be mutated if `revs is self._phasesets[p]`.

> +            if wdirrev in subset and repo[None].phase() in phases:
> +                # The working dir is in the subset being filtered, and its
> +                # phase is in the phases *not* being returned, so add it to the
> +                # set of revisions to filter out.
> +                revs.add(wdirrev)

Same here.


More information about the Mercurial-devel mailing list