tests/test-obsolete-changeset-exchange.t
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 08 Jul 2015 16:19:09 -0700
changeset 25761 0d37b9b21467
parent 22955 fab9dda0f2a3
child 27227 f20533623833
permissions -rw-r--r--
hg: support for auto sharing stores when cloning Many 3rd party consumers of Mercurial have created wrappers to essentially perform clone+share as a single operation. This is especially popular in automated processes like continuous integration systems. The Jenkins CI software and Mozilla's Firefox release automation infrastructure have both implemented custom code that effectively perform clone+share. The common use case here is that clients want to obtain N>1 checkouts while minimizing disk space and network requirements. Furthermore, they often don't care that a clone is an exact mirror of a remote: they are simply looking to obtain checkouts of specific revisions. When multiple third parties implement a similar feature, it's a good sign that the feature is worth adding to the core product. This patch adds support for an easy-to-use clone+share feature. The internal "clone" function now accepts options to control auto sharing during clone. When the auto share mode is active, a store will be created/updated under the base directory specified and a new repository pointing to the shared store will be created at the path specified by the user. The share extension has grown the ability to pass these options into the clone command/function. No command line options for this feature are added because we don't feel the feature will be popular enough to warrant their existence. There are two modes for auto share mode. In the default mode, the shared repo is derived from the first changeset (rev 0) in the remote repository. This enables related repositories existing at different URLs to automatically use the same storage. In environments that operate several repositories (separate repo for branch/head/bookmark or separate repo per user), this has the potential to drastically reduce storage and network requirements. In the other mode, the name is derived from the remote's path/URL.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17248
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     1
Test changesets filtering during exchanges (some tests are still in
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     2
test-obsolete.t)
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
     3
22955
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 18499
diff changeset
     4
  $ cat >> $HGRCPATH << EOF
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 18499
diff changeset
     5
  > [experimental]
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 18499
diff changeset
     6
  > evolution=createmarkers
17296
a1f8869f2eee obsolete: introduce an `_enabled` switch to disable the feature by default
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17248
diff changeset
     7
  > EOF
a1f8869f2eee obsolete: introduce an `_enabled` switch to disable the feature by default
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17248
diff changeset
     8
17327
7f5094bb3f42 test: fix typo in test comment
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17296
diff changeset
     9
Push does not corrupt remote
7f5094bb3f42 test: fix typo in test comment
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17296
diff changeset
    10
----------------------------
17248
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    11
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    12
Create a DAG where a changeset reuses a revision from a file first used in an
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    13
extinct changeset.
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    14
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    15
  $ hg init local
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    16
  $ cd local
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    17
  $ echo 'base' > base
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    18
  $ hg commit -Am base
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    19
  adding base
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    20
  $ echo 'A' > A
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    21
  $ hg commit -Am A
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    22
  adding A
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    23
  $ hg up 0
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    24
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    25
  $ hg revert -ar 1
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    26
  adding A
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    27
  $ hg commit -Am "A'"
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    28
  created new head
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    29
  $ hg log -G --template='{desc} {node}'
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    30
  @  A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    31
  |
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    32
  | o  A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    33
  |/
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    34
  o  base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    35
  
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    36
  $ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    37
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    38
Push it. The bundle should not refer to the extinct changeset.
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    39
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    40
  $ hg init ../other
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    41
  $ hg push ../other
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    42
  pushing to ../other
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    43
  searching for changes
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    44
  adding changesets
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    45
  adding manifests
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    46
  adding file changes
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    47
  added 2 changesets with 2 changes to 2 files
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    48
  $ hg -R ../other verify
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    49
  checking changesets
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    50
  checking manifests
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    51
  crosschecking files in changesets and manifests
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    52
  checking files
6ffb35b2284c discovery: add extinct changesets to outgoing.excluded
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
    53
  2 files, 2 changesets, 2 total revisions
18498
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    54
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    55
Adding a changeset going extinct locally
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    56
------------------------------------------
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    57
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    58
Pull a changeset that will immediatly goes extinct (because you already have a
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    59
marker to obsolete him)
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    60
(test resolution of issue3788)
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    61
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    62
  $ hg phase --draft --force f89bcc95eba5
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    63
  $ hg phase -R ../other --draft --force f89bcc95eba5
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    64
  $ hg commit --amend -m "A''"
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    65
  $ hg --hidden --config extensions.mq= strip  --no-backup f89bcc95eba5
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    66
  $ hg pull ../other
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    67
  pulling from ../other
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    68
  searching for changes
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    69
  adding changesets
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    70
  adding manifests
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    71
  adding file changes
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    72
  added 1 changesets with 0 changes to 1 files (+1 heads)
4d9f7dd2ac82 pull: fix crash when pulling changeset that get hidden locally (issue3788)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17327
diff changeset
    73
  (run 'hg heads' to see heads, 'hg merge' to merge)
18499
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    74
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    75
check that bundle is not affected
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    76
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    77
  $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    78
  1 changesets found
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    79
  $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    80
  $ hg unbundle ../f89bcc95eba5.hg
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    81
  adding changesets
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    82
  adding manifests
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    83
  adding file changes
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    84
  added 1 changesets with 0 changes to 1 files (+1 heads)
d07834e52b4e test-obsolete: validate that bundle is not affected by issue3788
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18498
diff changeset
    85
  (run 'hg heads' to see heads)