tests/test-remotefilelog-share.t
author Pulkit Goyal <7895pulkit@gmail.com>
Tue, 14 Apr 2020 21:07:09 +0530
changeset 45483 d252f51ab032
parent 40722 0800d9e6e216
permissions -rw-r--r--
share: introduce config option to store requires in .hg/store This introduces a config option which enabled stores the requirements on a repository in store instead. When enabled, `.hg/requires` will contain the `share-safe` requirement which marks that the requirements are present in the store. This is done so that repository requirements can be shared with shares made using `hg share` command. After this patch, `hg share` checks whether the source repository has share-safe requirement, if yes, it does not copy the requirements. Test for the new functionality is added and a test case in exitsing share tests is also added. Differential Revision: https://phab.mercurial-scm.org/D8633

#require no-windows

#testcases safe normal

#if safe
  $ echo "[format]"         >> $HGRCPATH
  $ echo "exp-share-safe = True" >> $HGRCPATH
#endif

  $ . "$TESTDIR/remotefilelog-library.sh"

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > remotefilelog=
  > share=
  > EOF

  $ hg init master
  $ cd master
  $ cat >> .hg/hgrc <<EOF
  > [remotefilelog]
  > server=True
  > EOF
  $ echo x > x
  $ hg commit -qAm x

  $ cd ..


  $ hgcloneshallow ssh://user@dummy/master source --noupdate -q
  $ hg share source dest
  updating working directory
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg -R dest unshare