D7705: phases: make the working directory consistently a draft

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Jan 9 08:54:07 EST 2020


yuja added a comment.


  > @@ -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.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7705/new/

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

To: rdamazio, #hg-reviewers, marmoute
Cc: yuja, marmoute, mercurial-devel


More information about the Mercurial-devel mailing list