Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 18210:f730ed2e093d
phases: prepare phase command for filtering
The phase command have some logic to report change made. We ensure this logic
run unfiltered.
With --force the command can change phase of a changeset for public to draft.
Such change can lead to obsolescence marker to apply again and the changeset to
be "hidden". If we do not run the logic unfiltered it could failed to fetch the
phase of a newly filtered changeset.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Mon, 24 Dec 2012 11:58:40 +0100 |
parents | 6a91cbb67907 |
children | 2dfe519d435d |
comparison
equal
deleted
inserted
replaced
18209:6a91cbb67907 | 18210:f730ed2e093d |
---|---|
4627 phases.advanceboundary(repo, targetphase, nodes) | 4627 phases.advanceboundary(repo, targetphase, nodes) |
4628 if opts['force']: | 4628 if opts['force']: |
4629 phases.retractboundary(repo, targetphase, nodes) | 4629 phases.retractboundary(repo, targetphase, nodes) |
4630 finally: | 4630 finally: |
4631 lock.release() | 4631 lock.release() |
4632 newdata = repo._phasecache.getphaserevs(repo) | 4632 # moving revision from public to draft may hide them |
4633 cl = repo.changelog | 4633 # We have to check result on an unfiltered repository |
4634 unfi = repo.unfiltered() | |
4635 newdata = repo._phasecache.getphaserevs(unfi) | |
4634 changes = sum(o != newdata[i] for i, o in enumerate(olddata)) | 4636 changes = sum(o != newdata[i] for i, o in enumerate(olddata)) |
4637 cl = unfi.changelog | |
4635 rejected = [n for n in nodes | 4638 rejected = [n for n in nodes |
4636 if newdata[cl.rev(n)] < targetphase] | 4639 if newdata[cl.rev(n)] < targetphase] |
4637 if rejected: | 4640 if rejected: |
4638 ui.warn(_('cannot move %i changesets to a more permissive ' | 4641 ui.warn(_('cannot move %i changesets to a more permissive ' |
4639 'phase, use --force\n') % len(rejected)) | 4642 'phase, use --force\n') % len(rejected)) |