tests/test-phase-archived.t
author Boris Feld <boris.feld@octobus.net>
Tue, 16 Oct 2018 15:48:00 +0200
changeset 41798 8c42b4a3d447
child 41799 64de5f44eec3
permissions -rw-r--r--
strip: introduce a soft strip option This is the first user-accessible way to use the archived phase introduced in 4.8. This implements a feature discussed during the Stockholm sprint, using the archived phase for hiding changesets. The archived phase behaves exactly as stripping: changesets are no longer visible, but pulling/unbundling them will make then reappear. The only notable difference is that unlike hard stripping, soft stripping does not affect obsmarkers. The next changeset will make use of the archived phase for history rewriting command. However, having a way to manually trigger the feature first seems a necessary step before exposing users to this phase; there is a way to un-archived changesets (unbundling), so there must be a way to archive them again. Adding a flag to strip is a good way to provide access to the feature without taking a too big risk on the final UI we want. The flag is experimental so it won't be exposed by default. Using the archived phase is faster and less traumatic for the repository than actually stripping changesets.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41798
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     1
=========================================================
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     2
Test features and behaviors related to the archived phase
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     3
=========================================================
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     4
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     5
  $ cat << EOF >> $HGRCPATH
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
  > [format]
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     7
  > internal-phase=yes
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     8
  > [extensions]
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     9
  > strip=
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    10
  > [experimental]
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    11
  > EOF
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    12
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    13
  $ hg init repo
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    14
  $ cd repo
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    15
  $ echo  root > a
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    16
  $ hg add a
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    17
  $ hg ci -m 'root'
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    18
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    19
Test that bundle can unarchive a changeset
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    20
------------------------------------------
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    21
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    22
  $ echo foo >> a
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    23
  $ hg st
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    24
  M a
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    25
  $ hg ci -m 'unbundletesting'
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    26
  $ hg log -G
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    27
  @  changeset:   1:883aadbbf309
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    28
  |  tag:         tip
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    29
  |  user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    30
  |  date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    31
  |  summary:     unbundletesting
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    32
  |
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    33
  o  changeset:   0:c1863a3840c6
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    34
     user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    35
     date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    36
     summary:     root
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    37
  
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    38
  $ hg strip --soft --rev '.'
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    39
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    40
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/883aadbbf309-efc55adc-backup.hg
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    41
  $ hg log -G
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    42
  @  changeset:   0:c1863a3840c6
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    43
     tag:         tip
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    44
     user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    45
     date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    46
     summary:     root
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    47
  
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    48
  $ hg log -G --hidden
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    49
  o  changeset:   1:883aadbbf309
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    50
  |  tag:         tip
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    51
  |  user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    52
  |  date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    53
  |  summary:     unbundletesting
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    54
  |
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    55
  @  changeset:   0:c1863a3840c6
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    56
     user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    57
     date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    58
     summary:     root
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    59
  
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    60
  $ hg unbundle .hg/strip-backup/883aadbbf309-efc55adc-backup.hg
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    61
  adding changesets
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    62
  adding manifests
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    63
  adding file changes
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    64
  added 0 changesets with 0 changes to 1 files
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    65
  (run 'hg update' to get a working copy)
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    66
  $ hg log -G
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    67
  o  changeset:   1:883aadbbf309
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    68
  |  tag:         tip
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    69
  |  user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    70
  |  date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    71
  |  summary:     unbundletesting
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    72
  |
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    73
  @  changeset:   0:c1863a3840c6
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    74
     user:        test
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    75
     date:        Thu Jan 01 00:00:00 1970 +0000
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    76
     summary:     root
8c42b4a3d447 strip: introduce a soft strip option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    77