Patchwork D9940: rhg: Add basic test with a shared repository

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2021, 6:40 p.m.
Message ID <differential-rev-PHID-DREV-5ls4f2iba2pmishtduan-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48251/
State Superseded
Headers show

Comments

phabricator - Feb. 1, 2021, 6:40 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9940

AFFECTED FILES
  tests/test-rhg.t

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -196,3 +196,67 @@ 
   of
   $ rhg cat -r c3ae8dec9fad of
   r5000
+
+Crate a shared repository
+
+  $ echo "[extensions]"      >> $HGRCPATH
+  $ echo "share = "          >> $HGRCPATH
+
+  $ cd $TESTTMP
+  $ hg init repo1
+  $ cd repo1
+  $ echo a > a
+  $ hg commit -A -m'init'
+  adding a
+
+  $ cd ..
+  $ hg share repo1 repo2
+  updating working directory
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+And check that basic rhg commands work with sharing
+
+  $ cd repo2
+  $ rhg files
+  [252]
+  $ rhg cat -r 0 a
+  [252]
+
+Same with relative sharing
+
+  $ cd ..
+  $ hg share repo2 repo3 --relative
+  updating working directory
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd repo3
+  $ rhg files
+  [252]
+  $ rhg cat -r 0 a
+  [252]
+
+Same with share-safe
+
+  $ echo "[format]"         >> $HGRCPATH
+  $ echo "use-share-safe = True" >> $HGRCPATH
+
+  $ cd $TESTTMP
+  $ hg init repo4
+  $ cd repo4
+  $ echo a > a
+  $ hg commit -A -m'init'
+  adding a
+
+  $ cd ..
+  $ hg share repo4 repo5
+  updating working directory
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+And check that basic rhg commands work with sharing
+
+  $ cd repo5
+  $ rhg files
+  [252]
+  $ rhg cat -r 0 a
+  [252]
+