Before this change, hg log -r 'wdir() and public()' would return it.
Details
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
The working copy is not necessarly draft phase. For example, it will be secret is the working copy parent is secret. One can also control it using the phases.new-commit config.
The mercurial.phases.newcommitphase(ui) function can help you there.
Thanks.
About newcommitphase - that only accounts for the config option, and it seems that the working directory doesn't change phase based on that in other parts of the code (e.g. in commitablectx), so I kept that consistent here.
commitablectx code seems wrong here. I am sending a patch.
Sure. Let me know if your patch is going to somehow cover the use case I'm trying to address here, or what else you'd like me to do with this patch (is it just a matter of adding more tests here to account for the config option mix as well, once you add that?).
I simply sent this: D7726. If am I following your changeset right, we should have wdir() match draft() or secret() according to the projected phase (config + parent)
In short we should have a test matching
$ hg log -r 'wdir() and secret()' -T '{phase}\n' --config phases.new-commit=secret secret
@@ -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.