tests/test-remotefilelog-share.t
author Martin von Zweigbergk <martinvonz@google.com>
Fri, 09 Nov 2018 10:47:24 -0800
changeset 40577 157f0e29eaa3
parent 40575 fb490d798be0
child 40722 0800d9e6e216
permissions -rw-r--r--
remotefilelog: avoid accessing repo instance after dispatch Upstream commit c5e6c1ba1c79 (hg: don't reuse repo instance after unshare(), 2018-09-12) poisoned the repo instance after unshare(). That made `hg unshare` fail with remotefilelog because we tried to close the fileserverclient after dispatch by accessing it via the repo. This patch fixes that by storing the reference to the fileserverclient at the beginning of dispatch. An analogous patch was sent for remotefilelog version in FB's hg-experimental as D5246. Differential Revision: https://phab.mercurial-scm.org/D5253
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40575
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     1
  $ . "$TESTDIR/remotefilelog-library.sh"
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     2
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     4
  > [extensions]
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     5
  > remotefilelog=
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     6
  > share=
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     7
  > EOF
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     8
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     9
  $ hg init master
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    10
  $ cd master
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    11
  $ cat >> .hg/hgrc <<EOF
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    12
  > [remotefilelog]
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    13
  > server=True
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    14
  > EOF
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    15
  $ echo x > x
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    16
  $ hg commit -qAm x
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    17
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    18
  $ cd ..
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    19
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    20
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    21
  $ hgcloneshallow ssh://user@dummy/master source --noupdate -q
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    22
  $ hg share source dest
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    23
  updating working directory
fb490d798be0 share: reload repo after adjusting it in postshare()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    24
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
40577
157f0e29eaa3 remotefilelog: avoid accessing repo instance after dispatch
Martin von Zweigbergk <martinvonz@google.com>
parents: 40575
diff changeset
    25
  $ hg -R dest unshare