diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -183,7 +183,10 @@ def copystore(ui, srcrepo, destpath): try: hardlink = None num = 0 + srcpublishing = srcrepo.ui.configbool('phases', 'publish', True) for f in srcrepo.store.copylist(): + if srcpublishing and f.endswith('phaseroots'): + continue src = os.path.join(srcrepo.sharedpath, f) dst = os.path.join(destpath, f) dstbase = os.path.dirname(dst) 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 @@ -589,3 +589,21 @@ 1. cloning non-publishing repository 1 0 a-B - 548a3d25dbf0 0 0 a-A - 054250a37db4 +2. cloning publishing repository + +(everything should be public) + + $ hg clone -U alpha Upsilon + $ hgph -R Upsilon + 11 0 A-secret - 435b5d83910c + 10 0 a-H - 967b449fbc94 + 9 0 a-G - 3e27b6f1eee1 + 8 0 a-F - b740e3e5c05d + 7 0 a-E - e9f537e46dea + 6 0 n-B - 145e75495359 + 5 0 n-A - d6bcb4f74035 + 4 0 b-A - f54f1bb90ff3 + 3 0 a-D - b555f63b6063 + 2 0 a-C - 54acac6f23ab + 1 0 a-B - 548a3d25dbf0 + 0 0 a-A - 054250a37db4