comparison tests/test-topic-stack-complex.t @ 3277:0a6954bd6502 stable

tests: add a test showing traceback on `hg stack` in case of split The traceback will be fixed in the next patch.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 11 Dec 2017 23:33:50 +0530
parents
children e4c0332ecee4
comparison
equal deleted inserted replaced
3272:11a2bc798deb 3277:0a6954bd6502
1 Testing `hg stack` on complex cases when we have multiple successors because of
2 divergence, split etc.
3 $ . "$TESTDIR/testlib/topic_setup.sh"
4
5 Setup
6
7 $ cat << EOF >> $HGRCPATH
8 > [experimental]
9 > evolution = all
10 > [ui]
11 > interactive = True
12 > [extensions]
13 > show =
14 > EOF
15 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
16
17 $ hg init test
18 $ cd test
19 $ echo foo > foo
20 $ hg add foo
21 $ hg ci -m "Added foo"
22 $ hg phase -r . --public
23 $ hg topic foo
24 marked working directory as topic: foo
25 $ echo a > a
26 $ echo b > b
27 $ hg ci -Aqm "Added a and b"
28 $ echo c > c
29 $ echo d > d
30 $ hg ci -Aqm "Added c and d"
31 $ echo e > e
32 $ echo f > f
33 $ hg ci -Aqm "Added e and f"
34 $ hg show work
35 @ f1d3 (foo) Added e and f
36 o 8e82 (foo) Added c and d
37 o 002b (foo) Added a and b
38 o f360 Added foo
39
40 Testing in case of split within the topic
41
42 $ hg stack
43 ### topic: foo
44 ### target: default (branch)
45 t3@ Added e and f (current)
46 t2: Added c and d
47 t1: Added a and b
48 t0^ Added foo (base)
49 $ hg prev
50 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
51 [2] Added c and d
52
53 $ echo 0 > num
54 $ cat > editor.sh << '__EOF__'
55 > NUM=$(cat num)
56 > NUM=`expr "$NUM" + 1`
57 > echo "$NUM" > num
58 > echo "split$NUM" > "$1"
59 > __EOF__
60 $ export HGEDITOR="\"sh\" \"editor.sh\""
61
62 $ hg split << EOF
63 > y
64 > y
65 > n
66 > y
67 > EOF
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
69 adding c
70 adding d
71 diff --git a/c b/c
72 new file mode 100644
73 examine changes to 'c'? [Ynesfdaq?] y
74
75 @@ -0,0 +1,1 @@
76 +c
77 record change 1/2 to 'c'? [Ynesfdaq?] y
78
79 diff --git a/d b/d
80 new file mode 100644
81 examine changes to 'd'? [Ynesfdaq?] n
82
83 Done splitting? [yN] y
84
85 $ hg stack
86 ### topic: foo
87 ### target: default (branch)
88 t4$ Added e and f (unstable)
89 t3@ split2 (current)
90 t2: split1
91 t1: Added a and b
92 t0^ Added foo (base)
93
94 $ hg show work
95 @ 5cce (foo) split2
96 o f26c (foo) split1
97 | o f1d3 (foo) Added e and f
98 | x 8e82 (foo) Added c and d
99 |/
100 o 002b (foo) Added a and b
101 o f360 Added foo
102
103 $ hg prev
104 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
105 [4] split1
106 $ echo foo > c
107 $ hg diff
108 diff -r f26c1b9addde c
109 --- a/c Thu Jan 01 00:00:00 1970 +0000
110 +++ b/c Thu Jan 01 00:00:00 1970 +0000
111 @@ -1,1 +1,1 @@
112 -c
113 +foo
114
115 $ hg amend
116 1 new orphan changesets
117 $ hg show work
118 @ 7d94 (foo) split1
119 | o 5cce (foo) split2
120 | x f26c (foo) split1
121 |/
122 | o f1d3 (foo) Added e and f
123 | x 8e82 (foo) Added c and d
124 |/
125 o 002b (foo) Added a and b
126 o f360 Added foo
127
128 $ hg stack
129 ### topic: foo (2 heads)
130 ### target: default (branch), 2 behind
131 ** unknown exception encountered, please report by visiting
132 ** https://mercurial-scm.org/wiki/BugTracker
133 ** Python 2.7.12 (default, Jul 18 2016, 15:04:44) [GCC 4.8.4]
134 ** Mercurial Distributed SCM (version 4.4.2+379-6812f5c492c7)
135 ** Extensions loaded: rebase, topic, show, evolve
136 Traceback (most recent call last):
137 File "/tmp/hgtests.d2IKdr/install/bin/hg", line 41, in <module>
138 dispatch.run()
139 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 88, in run
140 status = (dispatch(req) or 0) & 255
141 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 177, in dispatch
142 ret = _runcatch(req)
143 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 318, in _runcatch
144 return _callcatch(ui, _runcatchfunc)
145 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 326, in _callcatch
146 return scmutil.callcatch(ui, func)
147 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/scmutil.py", line 154, in callcatch
148 return func()
149 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 308, in _runcatchfunc
150 return _dispatch(req)
151 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 912, in _dispatch
152 cmdpats, cmdoptions)
153 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 667, in runcommand
154 ret = _runcommand(ui, options, cmd, d)
155 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 920, in _runcommand
156 return cmdfunc()
157 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/dispatch.py", line 909, in <lambda>
158 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
159 File "/tmp/hgtests.d2IKdr/install/lib/python/mercurial/util.py", line 1188, in check
160 return func(*args, **kwargs)
161 File "/home/pulkit/repo/mutable-history/hgext3rd/topic/__init__.py", line 663, in cmdstack
162 return stack.showstack(ui, repo, branch=branch, topic=topic, opts=opts)
163 File "/home/pulkit/repo/mutable-history/hgext3rd/topic/stack.py", line 288, in showstack
164 p1 = repo[_singlesuccessor(repo, p1)]
165 File "/home/pulkit/repo/mutable-history/hgext3rd/topic/evolvebits.py", line 92, in _singlesuccessor
166 raise MultipleSuccessorsError(newer)
167 hgext3rd.topic.evolvebits.MultipleSuccessorsError
168 [1]