D6384: tests: separate out bookmarks tests from test-share.t
martinvonz created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6384 AFFECTED FILES tests/test-share-bookmarks.t tests/test-share.t CHANGE DETAILS diff --git a/tests/test-share.t b/tests/test-share.t --- a/tests/test-share.t +++ b/tests/test-share.t @@ -157,251 +157,16 @@ $ cd .. -test sharing bookmarks - - $ hg share -B repo1 repo3 - updating working directory - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd repo1 - $ hg bookmark bm1 - $ hg bookmarks - * bm1 2:c2e0ac586386 - $ cd ../repo2 - $ hg book bm2 - $ hg bookmarks - * bm2 3:0e6e70d1d5f1 - $ cd ../repo3 - $ hg bookmarks - bm1 2:c2e0ac586386 - $ hg book bm3 - $ hg bookmarks - bm1 2:c2e0ac586386 - * bm3 2:c2e0ac586386 - $ cd ../repo1 - $ hg bookmarks - * bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - -check whether HG_PENDING makes pending changes only in relatd -repositories visible to an external hook. - -In "hg share" case, another transaction can't run in other -repositories sharing same source repository, because starting -transaction requires locking store of source repository. - -Therefore, this test scenario ignores checking visibility of -.hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks. - - $ cat > $TESTTMP/checkbookmarks.sh < echo "@repo1" - > hg -R "$TESTTMP/repo1" bookmarks - > echo "@repo2" - > hg -R "$TESTTMP/repo2" bookmarks - > echo "@repo3" - > hg -R "$TESTTMP/repo3" bookmarks - > exit 1 # to avoid adding new bookmark for subsequent tests - > EOF - - $ cd ../repo1 - $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX - @repo1 - bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - * bmX 2:c2e0ac586386 - @repo2 - * bm2 3:0e6e70d1d5f1 - @repo3 - bm1 2:c2e0ac586386 - * bm3 2:c2e0ac586386 - bmX 2:c2e0ac586386 - transaction abort! - rollback completed - abort: pretxnclose hook exited with status 1 - [255] - $ hg book bm1 - -FYI, in contrast to above test, bmX is invisible in repo1 (= shared -src), because (1) HG_PENDING refers only repo3 and (2) -"bookmarks.pending" is written only into repo3. - - $ cd ../repo3 - $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX - @repo1 - * bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - @repo2 - * bm2 3:0e6e70d1d5f1 - @repo3 - bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - * bmX 2:c2e0ac586386 - transaction abort! - rollback completed - abort: pretxnclose hook exited with status 1 - [255] - $ hg book bm3 - - $ cd ../repo1 - -test that commits work - - $ echo 'shared bookmarks' > a - $ hg commit -m 'testing shared bookmarks' - $ hg bookmarks - * bm1 3:b87954705719 - bm3 2:c2e0ac586386 - $ cd ../repo3 - $ hg bookmarks - bm1 3:b87954705719 - * bm3 2:c2e0ac586386 - $ echo 'more shared bookmarks' > a - $ hg commit -m 'testing shared bookmarks' - created new head - $ hg bookmarks - bm1 3:b87954705719 - * bm3 4:62f4ded848e4 - $ cd ../repo1 - $ hg bookmarks - * bm1 3:b87954705719 - bm3 4:62f4ded848e4 - $ cd .. - non largefiles repos won't enable largefiles - $ hg share --config extensions.largefiles= repo3 sharedrepo + $ hg share --config extensions.largefiles= repo2 sharedrepo The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) updating working directory 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ [ -f sharedrepo/.hg/hgrc ] [1] -test pushing bookmarks works - - $ hg clone repo3 repo4 - updating to branch default - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd repo4 - $ hg boo bm4 - $ echo foo > b - $ hg commit -m 'foo in b' - $ hg boo - bm1 3:b87954705719 - bm3 4:62f4ded848e4 - * bm4 5:92793bfc8cad - $ hg push -B bm4 - pushing to $TESTTMP/repo3 - searching for changes - adding changesets - adding manifests - adding file changes - added 1 changesets with 1 changes to 1 files - exporting bookmark bm4 - $ cd ../repo1
D6384: tests: separate out bookmarks tests from test-share.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHGfb00b3d76995: tests: separate out bookmarks tests from test-share.t (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6384?vs=15128&id=15135 REVISION DETAIL https://phab.mercurial-scm.org/D6384 AFFECTED FILES tests/test-share-bookmarks.t tests/test-share.t CHANGE DETAILS diff --git a/tests/test-share.t b/tests/test-share.t --- a/tests/test-share.t +++ b/tests/test-share.t @@ -157,251 +157,16 @@ $ cd .. -test sharing bookmarks - - $ hg share -B repo1 repo3 - updating working directory - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd repo1 - $ hg bookmark bm1 - $ hg bookmarks - * bm1 2:c2e0ac586386 - $ cd ../repo2 - $ hg book bm2 - $ hg bookmarks - * bm2 3:0e6e70d1d5f1 - $ cd ../repo3 - $ hg bookmarks - bm1 2:c2e0ac586386 - $ hg book bm3 - $ hg bookmarks - bm1 2:c2e0ac586386 - * bm3 2:c2e0ac586386 - $ cd ../repo1 - $ hg bookmarks - * bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - -check whether HG_PENDING makes pending changes only in relatd -repositories visible to an external hook. - -In "hg share" case, another transaction can't run in other -repositories sharing same source repository, because starting -transaction requires locking store of source repository. - -Therefore, this test scenario ignores checking visibility of -.hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks. - - $ cat > $TESTTMP/checkbookmarks.sh < echo "@repo1" - > hg -R "$TESTTMP/repo1" bookmarks - > echo "@repo2" - > hg -R "$TESTTMP/repo2" bookmarks - > echo "@repo3" - > hg -R "$TESTTMP/repo3" bookmarks - > exit 1 # to avoid adding new bookmark for subsequent tests - > EOF - - $ cd ../repo1 - $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX - @repo1 - bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - * bmX 2:c2e0ac586386 - @repo2 - * bm2 3:0e6e70d1d5f1 - @repo3 - bm1 2:c2e0ac586386 - * bm3 2:c2e0ac586386 - bmX 2:c2e0ac586386 - transaction abort! - rollback completed - abort: pretxnclose hook exited with status 1 - [255] - $ hg book bm1 - -FYI, in contrast to above test, bmX is invisible in repo1 (= shared -src), because (1) HG_PENDING refers only repo3 and (2) -"bookmarks.pending" is written only into repo3. - - $ cd ../repo3 - $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX - @repo1 - * bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - @repo2 - * bm2 3:0e6e70d1d5f1 - @repo3 - bm1 2:c2e0ac586386 - bm3 2:c2e0ac586386 - * bmX 2:c2e0ac586386 - transaction abort! - rollback completed - abort: pretxnclose hook exited with status 1 - [255] - $ hg book bm3 - - $ cd ../repo1 - -test that commits work - - $ echo 'shared bookmarks' > a - $ hg commit -m 'testing shared bookmarks' - $ hg bookmarks - * bm1 3:b87954705719 - bm3 2:c2e0ac586386 - $ cd ../repo3 - $ hg bookmarks - bm1 3:b87954705719 - * bm3 2:c2e0ac586386 - $ echo 'more shared bookmarks' > a - $ hg commit -m 'testing shared bookmarks' - created new head - $ hg bookmarks - bm1 3:b87954705719 - * bm3 4:62f4ded848e4 - $ cd ../repo1 - $ hg bookmarks - * bm1 3:b87954705719 - bm3 4:62f4ded848e4 - $ cd .. - non largefiles repos won't enable largefiles - $ hg share --config extensions.largefiles= repo3 sharedrepo + $ hg share --config extensions.largefiles= repo2 sharedrepo The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) updating working directory 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ [ -f sharedrepo/.hg/hgrc ] [1] -test pushing bookmarks works - - $ hg clone repo3 repo4 - updating to branch default - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd repo4 - $ hg boo bm4 - $ echo foo > b - $ hg commit -m 'foo in b' - $ hg boo - bm1 3:b87954705719 - bm3 4:62f4ded848e4 - * bm4 5:92793bfc8cad - $ hg push -B bm4 - pushing to $TESTTMP/repo3 - searching for c