comparison tests/test-subrepo.t @ 18520:751135cca13c stable

subrepo: allows to drop courtesy phase sync (issue3781) Publishing server may contains draft changeset when they are created locally. As publishing is the default, it is actually fairly common. Because of this "inconsistency" phases synchronization may be done even to publishing server. This may cause severe issues for subrepo. It is possible to reference read-only repository as subrepo. Push in a super repo recursively push subrepo. Those pushes to potential read only repo are not optional, they are "suffered" not "choosed". This does not break because as the repo is untouched the push is supposed to be empty. If the reference repo locally contains draft changesets, a courtesy push is triggered to turn them public. As the repo is read only, the push fails (after possible prompt asking for credential). Failure of the sub-push aborts the whole subrepo push. This force the user to define a custom default-push for such subrepo. This changeset introduce a prevention of this error client side by skipping the courtesy phase synchronisation in problematic situation. The phases synchronisation is skipped when four conditions are gathered: - this is a subrepo push, (normal push to read-only repo) - and remote support phase - and remote is publishing - and no changesets was pushed (if we pushed changesets, repo is not read only) The internal config option used in this version is not definitive. It is here to demonstrate a working fix to the issue. In the future we probably wants to track subrepo changes and avoid pushing to untouched one. That will prevent any attempt to push to read-only or unreachable subrepo. Another fix to prevent courtesy push from older clients to push to newer server is also still needed.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 31 Jan 2013 01:44:29 +0100
parents 798ab869b2ee
children 5ed6a375e9ca b31e0be96c79
comparison
equal deleted inserted replaced
18519:ca430fb6a668 18520:751135cca13c
1060 $ hg forget s/f19 1060 $ hg forget s/f19
1061 $ hg st -S 1061 $ hg st -S
1062 ? s/f19 1062 ? s/f19
1063 $ rm s/f19 1063 $ rm s/f19
1064 $ cd .. 1064 $ cd ..
1065
1066 Courtesy phases synchronisation to publishing server does not block the push
1067 (issue3781)
1068
1069 $ cp -r main issue3781
1070 $ cp -r main issue3781-dest
1071 $ cd issue3781-dest/s
1072 $ hg phase tip # show we have draft changeset
1073 5: draft
1074 $ chmod a-w .hg/store/phaseroots # prevent phase push
1075 $ cd ../../issue3781
1076 $ cat >> .hg/hgrc << EOF
1077 > [paths]
1078 > default=../issue3781-dest/
1079 > EOF
1080 $ hg push
1081 pushing to $TESTTMP/issue3781-dest
1082 pushing subrepo s to $TESTTMP/issue3781-dest/s
1083 searching for changes
1084 no changes found
1085 searching for changes
1086 no changes found
1087 [1]
1088