Mercurial > hg
comparison hgext/mq.py @ 16290:9518cb55c822 stable
qfinish: comply with the phases.new-commit option in secret mode (issue3335)
In secret mode qfinished changeset were move to the draft phase in all case[1]
without regard to phases.new-commit value
This changeset ensure qfinish does not automatically promote a changeset
further than the phases.new-commit value.
Note: This may also result in qfinished changeset made public if
phases.new-commit is set to public.
[1] "In all case" where parent have a compatible phase. Qfinish keep never
altering phases of changeset not involved in the qfinish.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Sat, 24 Mar 2012 12:06:49 +0100 |
parents | 900eee0778d1 |
children | 9952ac7e0968 7ee8aa662937 |
comparison
equal
deleted
inserted
replaced
16289:aae219a99a6e | 16290:9518cb55c822 |
---|---|
841 patches = self._revpatches(repo, sorted(revs)) | 841 patches = self._revpatches(repo, sorted(revs)) |
842 qfinished = self._cleanup(patches, len(patches)) | 842 qfinished = self._cleanup(patches, len(patches)) |
843 if qfinished and repo.ui.configbool('mq', 'secret', False): | 843 if qfinished and repo.ui.configbool('mq', 'secret', False): |
844 # only use this logic when the secret option is added | 844 # only use this logic when the secret option is added |
845 oldqbase = repo[qfinished[0]] | 845 oldqbase = repo[qfinished[0]] |
846 if oldqbase.p1().phase() < phases.secret: | 846 tphase = repo.ui.config('phases', 'new-commit', phases.draft) |
847 phases.advanceboundary(repo, phases.draft, qfinished) | 847 if oldqbase.phase() > tphase and oldqbase.p1().phase() <= tphase: |
848 phases.advanceboundary(repo, tphase, qfinished) | |
848 | 849 |
849 def delete(self, repo, patches, opts): | 850 def delete(self, repo, patches, opts): |
850 if not patches and not opts.get('rev'): | 851 if not patches and not opts.get('rev'): |
851 raise util.Abort(_('qdelete requires at least one revision or ' | 852 raise util.Abort(_('qdelete requires at least one revision or ' |
852 'patch name')) | 853 'patch name')) |