annotate tests/test-histedit-no-backup.t @ 40417:49c7b701fdc2 stable

phase: add an archived phase This phase allows for hidden changesets in the "user space". It differs from the "internal" phase which is intended for internal by-product only. There have been discussions at the 4.8 sprint to use such phase to speedup cleanup after history rewriting operation. Shipping it in the same release as the 'internal-phase' groups the associated `requires` entry. The important bit is to have support for this phase in the earliest version of mercurial possible. Adding the UI to manipulate this new phase later seems fine. The current plan for archived usage and user interface are as follow. On a repository with internal-phase on and evolution off: * history rewriting command set rewritten changeset in the archived phase. (This mean updating the cleanupnodes method). * keep `hg unbundle .hg/strip-backup/X.hg` as a way to restore changeset for now (backup bundle need to contains phase data) * [maybe] add a `hg strip --soft` advance flag (a light way to expose the feature without getting in the way of a better UI) Mercurial 4.8 freeze is too close to get the above in by then. We don't introduce a new repository `requirement` as we reuse the one introduced with the 'archived' phase during the 4.8 cycle.
author Boris Feld <boris.feld@octobus.net>
date Wed, 17 Oct 2018 14:47:01 +0200
parents faea9b1980d9
children 6acbe86c6490
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38548
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
1 $ . "$TESTDIR/histedit-helpers.sh"
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
2
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
3 Enable extension used by this test
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
4 $ cat >>$HGRCPATH <<EOF
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
5 > [extensions]
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
6 > histedit=
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
7 > EOF
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
8
38738
faea9b1980d9 histedit: drop --no-backup option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38733
diff changeset
9 ==========================================
faea9b1980d9 histedit: drop --no-backup option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38733
diff changeset
10 Test history-editing-backup config option|
faea9b1980d9 histedit: drop --no-backup option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38733
diff changeset
11 ==========================================
38548
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
12 Repo setup:
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
13 $ hg init foo
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
14 $ cd foo
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
15 $ echo first>file
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
16 $ hg ci -qAm one
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
17 $ echo second>>file
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
18 $ hg ci -m two
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
19 $ echo third>>file
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
20 $ hg ci -m three
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
21 $ echo forth>>file
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
22 $ hg ci -m four
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
23 $ hg log -G --style compact
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
24 @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
25 | four
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
26 |
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
27 o 2 80d23dfa866d 1970-01-01 00:00 +0000 test
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
28 | three
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
29 |
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
30 o 1 6153eb23e623 1970-01-01 00:00 +0000 test
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
31 | two
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
32 |
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
33 o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
34 one
7b57b1ed5c0f histedit: add --no-backup option (issue5825)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
35
38733
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
36 Test when `history-editing-backup` config option is enabled:
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
37 $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
38 > pick 36b4bdd91f5b 0 one
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
39 > pick 6153eb23e623 1 two
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
40 > roll 80d23dfa866d 2 three
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
41 > edit 7d5187087c79 3 four
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
42 > EOF
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
43 merging file
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
44 Editing (7d5187087c79), you may commit or record as needed now.
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
45 (hg histedit --continue to resume)
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
46 [1]
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
47 $ hg histedit --abort
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
49 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
50 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
51
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
52 Test when `history-editing-backup` config option is not enabled
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
53 Enable config option:
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
54 $ cat >>$HGRCPATH <<EOF
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
55 > [ui]
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
56 > history-editing-backup=False
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
57 > EOF
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
58
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
59 $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
60 > pick 36b4bdd91f5b 0 one
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
61 > pick 6153eb23e623 1 two
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
62 > roll 80d23dfa866d 2 three
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
63 > edit 7d5187087c79 3 four
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
64 > EOF
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
65 merging file
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
66 Editing (7d5187087c79), you may commit or record as needed now.
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
67 (hg histedit --continue to resume)
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
68 [1]
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
69 $ hg histedit --abort
c2586a6e5884 histedit: add history-editing-backup config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38548
diff changeset
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved