sapling/tests/test-infinitepush-backup-share.t
Stanislau Hlebik 57dc185f42 infinitepush: don't make separate backups for different working copies
Summary:
Previously we had separate backup per working copy. That's very confusing
since all these working copies shares the same repo. This diff fixes it and
also adds config option to clean unnecessary working copy server-side.

Test Plan: Run infinitepush unittest

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: rmcelroy, quark, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4876230

Signature: t1:4876230:1492025747:3579e5046efc2ed309044fc3335c36ac4f7bdd04
2017-04-13 04:58:11 -07:00

40 lines
1.0 KiB
Perl

$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/library-infinitepush.sh"
$ setupcommon
$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> hg ci -m "$1"
> }
$ cat >> $HGRCPATH << EOF
> [extensions]
> share=
> EOF
$ hg init repo
$ cd repo
$ setupserver
$ cd ..
Clone client
$ hg clone ssh://user@dummy/repo client -q
$ hg share --bookmarks client client2
updating working directory
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client2
$ mkcommit first
$ hg paths
default = ssh://user@dummy/repo
$ hg pushbackup
starting backup .* (re)
searching for changes
remote: pushing 1 commit:
remote: b75a450e74d5 first
finished in \d+\.(\d+)? seconds (re)
$ scratchbookmarks
infinitepush/backups/test/*$TESTTMP/client/heads/b75a450e74d5a7708da8c3144fbeb4ac88694044 b75a450e74d5a7708da8c3144fbeb4ac88694044 (glob)
Make sure that backup state is saved only on the "main" repo
$ [ -f .hg/infinitepushbackupstate ]
[1]
$ [ -f ../client/.hg/infinitepushbackupstate ]