Show More
@@ -236,20 +236,7 b' def share(ui, source, dest=None, update=' | |||
|
236 | 236 | |
|
237 | 237 | r = repository(ui, destwvfs.base) |
|
238 | 238 | postshare(srcrepo, r, bookmarks=bookmarks) |
|
239 | ||
|
240 | if update: | |
|
241 | r.ui.status(_("updating working directory\n")) | |
|
242 | if update is not True: | |
|
243 | checkout = update | |
|
244 | for test in (checkout, 'default', 'tip'): | |
|
245 | if test is None: | |
|
246 | continue | |
|
247 | try: | |
|
248 | uprev = r.lookup(test) | |
|
249 | break | |
|
250 | except error.RepoLookupError: | |
|
251 | continue | |
|
252 | _update(r, uprev) | |
|
239 | _postshareupdate(r, update, checkout=checkout) | |
|
253 | 240 | |
|
254 | 241 | def postshare(sourcerepo, destrepo, bookmarks=True): |
|
255 | 242 | """Called after a new shared repo is created. |
@@ -272,6 +259,27 b' def postshare(sourcerepo, destrepo, book' | |||
|
272 | 259 | fp.write('bookmarks\n') |
|
273 | 260 | fp.close() |
|
274 | 261 | |
|
262 | def _postshareupdate(repo, update, checkout=None): | |
|
263 | """Maybe perform a working directory update after a shared repo is created. | |
|
264 | ||
|
265 | ``update`` can be a boolean or a revision to update to. | |
|
266 | """ | |
|
267 | if not update: | |
|
268 | return | |
|
269 | ||
|
270 | repo.ui.status(_("updating working directory\n")) | |
|
271 | if update is not True: | |
|
272 | checkout = update | |
|
273 | for test in (checkout, 'default', 'tip'): | |
|
274 | if test is None: | |
|
275 | continue | |
|
276 | try: | |
|
277 | uprev = repo.lookup(test) | |
|
278 | break | |
|
279 | except error.RepoLookupError: | |
|
280 | continue | |
|
281 | _update(repo, uprev) | |
|
282 | ||
|
275 | 283 | def copystore(ui, srcrepo, destpath): |
|
276 | 284 | '''copy files from store of srcrepo in destpath |
|
277 | 285 | |
@@ -361,7 +369,7 b' def clonewithshare(ui, peeropts, sharepa' | |||
|
361 | 369 | rev=rev, update=False, stream=stream) |
|
362 | 370 | |
|
363 | 371 | sharerepo = repository(ui, path=sharepath) |
|
364 |
share(ui, sharerepo, dest=dest, update= |
|
|
372 | share(ui, sharerepo, dest=dest, update=False, bookmarks=False) | |
|
365 | 373 | |
|
366 | 374 | # We need to perform a pull against the dest repo to fetch bookmarks |
|
367 | 375 | # and other non-store data that isn't shared by default. In the case of |
@@ -371,6 +379,8 b' def clonewithshare(ui, peeropts, sharepa' | |||
|
371 | 379 | destrepo = repository(ui, path=dest) |
|
372 | 380 | exchange.pull(destrepo, srcpeer, heads=revs) |
|
373 | 381 | |
|
382 | _postshareupdate(destrepo, update) | |
|
383 | ||
|
374 | 384 | return srcpeer, peer(ui, peeropts, dest) |
|
375 | 385 | |
|
376 | 386 | def clone(ui, peeropts, source, dest=None, pull=False, rev=None, |
@@ -774,11 +774,11 b' Clone from repo with content should resu' | |||
|
774 | 774 | adding manifests |
|
775 | 775 | adding file changes |
|
776 | 776 | added 3 changesets with 3 changes to 1 files |
|
777 | updating working directory | |
|
778 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
779 | 777 | searching for changes |
|
780 | 778 | no changes found |
|
781 | 779 | adding remote bookmark bookA |
|
780 | updating working directory | |
|
781 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
782 | 782 | |
|
783 | 783 | The shared repo should have been created |
|
784 | 784 | |
@@ -804,8 +804,6 b' Clone with existing share dir should res' | |||
|
804 | 804 | |
|
805 | 805 | $ hg --config share.pool=share clone source1b share-dest1b |
|
806 | 806 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
807 | updating working directory | |
|
808 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
809 | 807 | searching for changes |
|
810 | 808 | adding changesets |
|
811 | 809 | adding manifests |
@@ -813,6 +811,8 b' Clone with existing share dir should res' | |||
|
813 | 811 | added 4 changesets with 4 changes to 1 files (+4 heads) |
|
814 | 812 | adding remote bookmark head1 |
|
815 | 813 | adding remote bookmark head2 |
|
814 | updating working directory | |
|
815 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
816 | 816 | |
|
817 | 817 | $ ls share |
|
818 | 818 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
@@ -831,6 +831,17 b' Default path should be source, not share' | |||
|
831 | 831 | $ hg -R share-dest1b config paths.default |
|
832 | 832 | $TESTTMP/source1a (glob) |
|
833 | 833 | |
|
834 | Checked out revision should be head of default branch | |
|
835 | ||
|
836 | $ hg -R share-dest1b log -r . | |
|
837 | changeset: 4:99f71071f117 | |
|
838 | bookmark: head2 | |
|
839 | parent: 0:b5f04eac9d8f | |
|
840 | user: test | |
|
841 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
842 | summary: head2 | |
|
843 | ||
|
844 | ||
|
834 | 845 | Clone from unrelated repo should result in new share |
|
835 | 846 | |
|
836 | 847 | $ hg --config share.pool=share clone source2 share-dest2 |
@@ -840,10 +851,10 b' Clone from unrelated repo should result ' | |||
|
840 | 851 | adding manifests |
|
841 | 852 | adding file changes |
|
842 | 853 | added 2 changesets with 2 changes to 1 files |
|
854 | searching for changes | |
|
855 | no changes found | |
|
843 | 856 | updating working directory |
|
844 | 857 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
845 | searching for changes | |
|
846 | no changes found | |
|
847 | 858 | |
|
848 | 859 | $ ls share |
|
849 | 860 | 22aeff664783fd44c6d9b435618173c118c3448e |
@@ -858,11 +869,11 b' remote naming mode works as advertised' | |||
|
858 | 869 | adding manifests |
|
859 | 870 | adding file changes |
|
860 | 871 | added 3 changesets with 3 changes to 1 files |
|
861 | updating working directory | |
|
862 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
863 | 872 | searching for changes |
|
864 | 873 | no changes found |
|
865 | 874 | adding remote bookmark bookA |
|
875 | updating working directory | |
|
876 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
866 | 877 | |
|
867 | 878 | $ ls shareremote |
|
868 | 879 | 195bb1fcdb595c14a6c13e0269129ed78f6debde |
@@ -874,12 +885,12 b' remote naming mode works as advertised' | |||
|
874 | 885 | adding manifests |
|
875 | 886 | adding file changes |
|
876 | 887 | added 6 changesets with 6 changes to 1 files (+4 heads) |
|
877 | updating working directory | |
|
878 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
879 | 888 | searching for changes |
|
880 | 889 | no changes found |
|
881 | 890 | adding remote bookmark head1 |
|
882 | 891 | adding remote bookmark head2 |
|
892 | updating working directory | |
|
893 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
883 | 894 | |
|
884 | 895 | $ ls shareremote |
|
885 | 896 | 195bb1fcdb595c14a6c13e0269129ed78f6debde |
@@ -893,10 +904,10 b' request to clone a single revision is re' | |||
|
893 | 904 | adding manifests |
|
894 | 905 | adding file changes |
|
895 | 906 | added 2 changesets with 2 changes to 1 files |
|
907 | no changes found | |
|
908 | adding remote bookmark head1 | |
|
896 | 909 | updating working directory |
|
897 | 910 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
898 | no changes found | |
|
899 | adding remote bookmark head1 | |
|
900 | 911 | |
|
901 | 912 | $ hg -R share-1arev log -G |
|
902 | 913 | @ changeset: 1:4a8dc1ab4c13 |
@@ -916,8 +927,6 b' making another clone should only pull do' | |||
|
916 | 927 | |
|
917 | 928 | $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev |
|
918 | 929 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
919 | updating working directory | |
|
920 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
921 | 930 | searching for changes |
|
922 | 931 | adding changesets |
|
923 | 932 | adding manifests |
@@ -925,9 +934,11 b' making another clone should only pull do' | |||
|
925 | 934 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
926 | 935 | adding remote bookmark head1 |
|
927 | 936 | adding remote bookmark head2 |
|
937 | updating working directory | |
|
938 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
928 | 939 | |
|
929 | 940 | $ hg -R share-1brev log -G |
|
930 |
|
|
|
941 | @ changeset: 2:99f71071f117 | |
|
931 | 942 | | bookmark: head2 |
|
932 | 943 | | tag: tip |
|
933 | 944 | | parent: 0:b5f04eac9d8f |
@@ -935,7 +946,7 b' making another clone should only pull do' | |||
|
935 | 946 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
936 | 947 | | summary: head2 |
|
937 | 948 | | |
|
938 |
| |
|
|
949 | | o changeset: 1:4a8dc1ab4c13 | |
|
939 | 950 | |/ bookmark: head1 |
|
940 | 951 | | user: test |
|
941 | 952 | | date: Thu Jan 01 00:00:00 1970 +0000 |
@@ -955,9 +966,9 b' Request to clone a single branch is resp' | |||
|
955 | 966 | adding manifests |
|
956 | 967 | adding file changes |
|
957 | 968 | added 2 changesets with 2 changes to 1 files |
|
969 | no changes found | |
|
958 | 970 | updating working directory |
|
959 | 971 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
960 | no changes found | |
|
961 | 972 | |
|
962 | 973 | $ hg -R share-1bbranch1 log -G |
|
963 | 974 | o changeset: 1:5f92a6c1a1b1 |
@@ -975,13 +986,13 b' Request to clone a single branch is resp' | |||
|
975 | 986 | |
|
976 | 987 | $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2 |
|
977 | 988 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
978 | updating working directory | |
|
979 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
980 | 989 | searching for changes |
|
981 | 990 | adding changesets |
|
982 | 991 | adding manifests |
|
983 | 992 | adding file changes |
|
984 | 993 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
994 | updating working directory | |
|
995 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
985 | 996 | |
|
986 | 997 |
|
|
987 | 998 | o changeset: 2:6bacf4683960 |
@@ -1056,18 +1067,18 b" Cloning into pooled storage doesn't race" | |||
|
1056 | 1067 | adding manifests |
|
1057 | 1068 | adding file changes |
|
1058 | 1069 | added 3 changesets with 3 changes to 1 files |
|
1059 | updating working directory | |
|
1060 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
1061 | 1070 | searching for changes |
|
1062 | 1071 | no changes found |
|
1063 | 1072 | adding remote bookmark bookA |
|
1073 | updating working directory | |
|
1074 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
1064 | 1075 | |
|
1065 | 1076 | $ cat race2.log |
|
1066 | 1077 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1067 | updating working directory | |
|
1068 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
1069 | 1078 | waiting for lock on repository share-destrace2 held by * (glob) |
|
1070 | 1079 | got lock after \d+ seconds (re) |
|
1071 | 1080 | searching for changes |
|
1072 | 1081 | no changes found |
|
1073 | 1082 | adding remote bookmark bookA |
|
1083 | updating working directory | |
|
1084 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now