Mercurial > hg
comparison tests/test-histedit-obsolete.t @ 17759:9c7497cd39fd
histedit: add obsolete support
When the obsolete feature is enabled, histedit creates obsolescence marker
instead of stripping replaced changesets.
For now, we keep stripping temporary nodes created along the way.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Thu, 27 Sep 2012 13:59:48 +0200 |
parents | |
children | c80a7a0c7d22 |
comparison
equal
deleted
inserted
replaced
17758:5863f0e4cd3a | 17759:9c7497cd39fd |
---|---|
1 $ . "$TESTDIR/histedit-helpers.sh" | |
2 | |
3 Enable obsolete | |
4 | |
5 $ cat > ${TESTTMP}/obs.py << EOF | |
6 > import mercurial.obsolete | |
7 > mercurial.obsolete._enabled = True | |
8 > EOF | |
9 | |
10 $ cat >> $HGRCPATH << EOF | |
11 > [ui] | |
12 > logtemplate= {rev}:{node|short} {desc|firstline} | |
13 > [phases] | |
14 > publish=False | |
15 > [extensions]' | |
16 > histedit= | |
17 > | |
18 > obs=${TESTTMP}/obs.py | |
19 > EOF | |
20 | |
21 $ hg init base | |
22 $ cd base | |
23 | |
24 $ for x in a b c d e f ; do | |
25 > echo $x > $x | |
26 > hg add $x | |
27 > hg ci -m $x | |
28 > done | |
29 | |
30 $ hg log --graph | |
31 @ 5:652413bf663e f | |
32 | | |
33 o 4:e860deea161a e | |
34 | | |
35 o 3:055a42cdd887 d | |
36 | | |
37 o 2:177f92b77385 c | |
38 | | |
39 o 1:d2ae7f538514 b | |
40 | | |
41 o 0:cb9a9f314b8b a | |
42 | |
43 | |
44 $ HGEDITOR=cat hg histedit 1 | |
45 pick d2ae7f538514 1 b | |
46 pick 177f92b77385 2 c | |
47 pick 055a42cdd887 3 d | |
48 pick e860deea161a 4 e | |
49 pick 652413bf663e 5 f | |
50 | |
51 # Edit history between d2ae7f538514 and 652413bf663e | |
52 # | |
53 # Commands: | |
54 # p, pick = use commit | |
55 # e, edit = use commit, but stop for amending | |
56 # f, fold = use commit, but fold into previous commit (combines N and N-1) | |
57 # d, drop = remove commit from history | |
58 # m, mess = edit message without changing commit content | |
59 # | |
60 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
61 $ cat >> commands.txt <<EOF | |
62 > pick 177f92b77385 2 c | |
63 > drop d2ae7f538514 1 b | |
64 > pick 055a42cdd887 3 d | |
65 > fold e860deea161a 4 e | |
66 > pick 652413bf663e 5 f | |
67 > EOF | |
68 $ hg histedit 1 --commands commands.txt --verbose | grep histedit | |
69 saved backup bundle to $TESTTMP/base/.hg/strip-backup/34a9919932c1-backup.hg (glob) | |
70 $ hg log --graph --hidden | |
71 @ 8:0efacef7cb48 f | |
72 | | |
73 o 7:ae467701c500 d | |
74 | | |
75 o 6:d36c0562f908 c | |
76 | | |
77 | x 5:652413bf663e f | |
78 | | | |
79 | x 4:e860deea161a e | |
80 | | | |
81 | x 3:055a42cdd887 d | |
82 | | | |
83 | x 2:177f92b77385 c | |
84 | | | |
85 | x 1:d2ae7f538514 b | |
86 |/ | |
87 o 0:cb9a9f314b8b a | |
88 | |
89 $ hg debugobsolete | |
90 e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*', 'user': 'test'} (glob) | |
91 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '*': 'test'} (glob) | |
92 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '*', 'user': 'test'} (glob) | |
93 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*': 'test'} (glob) | |
94 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '*', 'user': 'test'} (glob) |