diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1992,8 +1992,12 @@ class localrepository(repo.repository): url=url, pending=p) added = [cl.node(r) for r in xrange(clstart, clend)] - if srctype != 'strip': - phases.advanceboundary(self, 0, added) + if self.ui.configbool('phases', 'publish', True): + if srctype != 'strip': + phases.advanceboundary(self, 0, added) + else: + phases.retractboundary(self, 1, added) + # make changelog see real files again cl.finalize(trp) diff --git a/tests/test-phases-exchange.t b/tests/test-phases-exchange.t --- a/tests/test-phases-exchange.t +++ b/tests/test-phases-exchange.t @@ -109,4 +109,30 @@ update must update phase of common chang 1 0 a-B 0 0 a-A +Publish configuration option +---------------------------- +changegroup are added without phase movement + + $ hg bundle -a ../base.bundle + 5 changesets found + $ cd .. + $ hg init mu + $ cd mu + $ cat > .hg/hgrc << EOF + > [phases] + > publish=0 + > EOF + $ hg unbundle ../base.bundle + adding changesets + adding manifests + adding file changes + added 5 changesets with 5 changes to 5 files (+1 heads) + (run 'hg heads' to see heads, 'hg merge' to merge) + $ hgph + 4 1 a-D + 3 1 a-C + 2 1 b-A + 1 1 a-B + 0 1 a-A +