Show More
@@ -621,7 +621,12 b' class localrepository(repo.repository):' | |||
|
621 | 621 | |
|
622 | 622 | def known(self, nodes): |
|
623 | 623 | nm = self.changelog.nodemap |
|
624 | return [(n in nm) for n in nodes] | |
|
624 | result = [] | |
|
625 | for n in nodes: | |
|
626 | r = nm.get(n) | |
|
627 | resp = not (r is None or self._phaserev[r] >= phases.secret) | |
|
628 | result.append(resp) | |
|
629 | return result | |
|
625 | 630 | |
|
626 | 631 | def local(self): |
|
627 | 632 | return self |
@@ -794,19 +794,136 b' Discovery locally secret changeset on a ' | |||
|
794 | 794 | | |
|
795 | 795 | o 0 public a-A - 054250a37db4 |
|
796 | 796 | |
|
797 | ||
|
798 | pull new changeset with common draft locally | |
|
799 | ||
|
800 | $ hg up -q 967b449fbc94 # create a new root for draft | |
|
801 | $ mkcommit 'alpha-more' | |
|
802 | created new head | |
|
803 | $ hg push -fr . ../mu | |
|
804 | pushing to ../mu | |
|
805 | searching for changes | |
|
806 | adding changesets | |
|
807 | adding manifests | |
|
808 | adding file changes | |
|
809 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
|
810 | $ cd ../mu | |
|
811 | $ hg phase --secret --force 1c5cfd894796 | |
|
812 | $ hg up -q 435b5d83910c | |
|
813 | $ mkcommit 'mu-more' | |
|
814 | $ cd ../alpha | |
|
815 | $ hg pull ../mu | |
|
816 | pulling from ../mu | |
|
817 | searching for changes | |
|
818 | adding changesets | |
|
819 | adding manifests | |
|
820 | adding file changes | |
|
821 | added 1 changesets with 1 changes to 1 files | |
|
822 | (run 'hg update' to get a working copy) | |
|
823 | $ hgph | |
|
824 | o 13 draft mu-more - 5237fb433fc8 | |
|
825 | | | |
|
826 | | @ 12 draft alpha-more - 1c5cfd894796 | |
|
827 | | | | |
|
828 | o | 11 draft A-secret - 435b5d83910c | |
|
829 | |/ | |
|
830 | o 10 public a-H - 967b449fbc94 | |
|
831 | | | |
|
832 | | o 9 draft a-G - 3e27b6f1eee1 | |
|
833 | | | | |
|
834 | | o 8 public a-F - b740e3e5c05d | |
|
835 | | | | |
|
836 | | o 7 public a-E - e9f537e46dea | |
|
837 | | | | |
|
838 | +---o 6 public n-B - 145e75495359 | |
|
839 | | | | |
|
840 | o | 5 public n-A - d6bcb4f74035 | |
|
841 | | | | |
|
842 | o | 4 public b-A - f54f1bb90ff3 | |
|
843 | | | | |
|
844 | | o 3 public a-D - b555f63b6063 | |
|
845 | | | | |
|
846 | | o 2 public a-C - 54acac6f23ab | |
|
847 | |/ | |
|
848 | o 1 public a-B - 548a3d25dbf0 | |
|
849 | | | |
|
850 | o 0 public a-A - 054250a37db4 | |
|
851 | ||
|
852 | ||
|
853 | Test that test are properly ignored on remote event when existing locally | |
|
854 | ||
|
797 | 855 | $ cd .. |
|
856 | $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma | |
|
857 | ||
|
858 | # pathological case are | |
|
859 | # | |
|
860 | # * secret remotely | |
|
861 | # * known locally | |
|
862 | # * repo have uncommon changeset | |
|
863 | ||
|
864 | $ hg -R beta phase --secret --force f54f1bb90ff3 | |
|
865 | $ hg -R gamma phase --draft --force f54f1bb90ff3 | |
|
866 | ||
|
867 | $ cd gamma | |
|
868 | $ hg pull ../beta | |
|
869 | pulling from ../beta | |
|
870 | searching for changes | |
|
871 | adding changesets | |
|
872 | adding manifests | |
|
873 | adding file changes | |
|
874 | added 2 changesets with 2 changes to 2 files | |
|
875 | (run 'hg update' to get a working copy) | |
|
876 | $ hg phase f54f1bb90ff3 | |
|
877 | 2: draft | |
|
878 | ||
|
879 | same over the wire | |
|
880 | ||
|
881 | $ cd ../beta | |
|
882 | $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log | |
|
883 | $ cat ../beta.pid >> $DAEMON_PIDS | |
|
884 | $ cd ../gamma | |
|
885 | ||
|
886 | $ hg pull http://localhost:$HGPORT/ | |
|
887 | pulling from http://localhost:$HGPORT/ | |
|
888 | searching for changes | |
|
889 | no changes found | |
|
890 | $ hg phase f54f1bb90ff3 | |
|
891 | 2: draft | |
|
892 | ||
|
893 | check that secret local on both side are not synced to public | |
|
894 | ||
|
895 | $ hg push -r b555f63b6063 http://localhost:$HGPORT/ | |
|
896 | pushing to http://localhost:$HGPORT/ | |
|
897 | searching for changes | |
|
898 | no changes found | |
|
899 | $ hg phase f54f1bb90ff3 | |
|
900 | 2: draft | |
|
901 | ||
|
902 | put the changeset in the draft state again | |
|
903 | (first test after this one expect to be able to copy) | |
|
904 | ||
|
905 | $ cd .. | |
|
906 | ||
|
907 | ||
|
798 | 908 | Test Clone behavior |
|
799 | 909 | |
|
800 | 910 | A. Clone without secret changeset |
|
801 | 911 | |
|
802 | 912 | 1. cloning non-publishing repository |
|
913 | (Phase should be preserved) | |
|
803 | 914 | |
|
804 | (Phase should be preserved° | |
|
915 | # make sure there is no secret so we can use a copy clone | |
|
916 | ||
|
917 | $ hg -R mu phase --draft 'secret()' | |
|
805 | 918 | |
|
806 | 919 | $ hg clone -U mu Tau |
|
807 | 920 | $ hgph -R Tau |
|
808 |
o 1 |
|
|
921 | o 12 draft mu-more - 5237fb433fc8 | |
|
809 | 922 | | |
|
923 | | o 11 draft alpha-more - 1c5cfd894796 | |
|
924 | | | | |
|
925 | o | 10 draft A-secret - 435b5d83910c | |
|
926 | |/ | |
|
810 | 927 | o 9 public a-H - 967b449fbc94 |
|
811 | 928 | | |
|
812 | 929 | | o 8 public a-F - b740e3e5c05d |
@@ -834,8 +951,12 b' 2. cloning publishing repository' | |||
|
834 | 951 | |
|
835 | 952 | $ hg clone -U alpha Upsilon |
|
836 | 953 | $ hgph -R Upsilon |
|
837 |
o 1 |
|
|
954 | o 13 public mu-more - 5237fb433fc8 | |
|
838 | 955 | | |
|
956 | | o 12 public alpha-more - 1c5cfd894796 | |
|
957 | | | | |
|
958 | o | 11 public A-secret - 435b5d83910c | |
|
959 | |/ | |
|
839 | 960 | o 10 public a-H - 967b449fbc94 |
|
840 | 961 | | |
|
841 | 962 | | o 9 public a-G - 3e27b6f1eee1 |
@@ -858,3 +979,4 b' 2. cloning publishing repository' | |||
|
858 | 979 | | |
|
859 | 980 | o 0 public a-A - 054250a37db4 |
|
860 | 981 | |
|
982 |
General Comments 0
You need to be logged in to leave comments.
Login now