Debian Codegraph @

tests/test-histedit-outgoing.t

raw
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
3 > histedit=
4 > EOF
5
6 $ initrepos ()
7 > {
8 > hg init r
9 > cd r
10 > for x in a b c ; do
11 > echo $x > $x
12 > hg add $x
13 > hg ci -m $x
14 > done
15 > cd ..
16 > hg clone r r2 | grep -v updating
17 > cd r2
18 > for x in d e f ; do
19 > echo $x > $x
20 > hg add $x
21 > hg ci -m $x
22 > done
23 > cd ..
24 > hg init r3
25 > cd r3
26 > for x in g h i ; do
27 > echo $x > $x
28 > hg add $x
29 > hg ci -m $x
30 > done
31 > cd ..
32 > }
33
34 $ initrepos
35 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
36
37 show the edit commands offered by outgoing
38 $ cd r2
39 $ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
40 pick 055a42cdd887 3 d
41 pick e860deea161a 4 e
42 pick 652413bf663e 5 f
43
44 # Edit history between 055a42cdd887 and 652413bf663e
45 #
46 # Commits are listed from least to most recent
47 #
48 # You can reorder changesets by reordering the lines
49 #
50 # Commands:
51 #
52 # e, edit = use commit, but allow edits before making new commit
53 # m, mess = edit commit message without changing commit content
54 # p, pick = use commit
55 # b, base = checkout changeset and apply further changesets from there
56 # d, drop = remove commit from history
57 # f, fold = use commit, but combine it with the one above
58 # r, roll = like fold, but discard this commit's description and date
59 #
60 $ cd ..
61
62 show the error from unrelated repos
63 $ cd r3
64 $ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
65 abort: repository is unrelated
66 [1]
67 $ cd ..
68
69 show the error from unrelated repos
70 $ cd r3
71 $ HGEDITOR=cat hg histedit --force --outgoing ../r
72 comparing with ../r
73 searching for changes
74 warning: repository is unrelated
75 pick 2a4042b45417 0 g
76 pick 68c46b4927ce 1 h
77 pick 51281e65ba79 2 i
78
79 # Edit history between 2a4042b45417 and 51281e65ba79
80 #
81 # Commits are listed from least to most recent
82 #
83 # You can reorder changesets by reordering the lines
84 #
85 # Commands:
86 #
87 # e, edit = use commit, but allow edits before making new commit
88 # m, mess = edit commit message without changing commit content
89 # p, pick = use commit
90 # b, base = checkout changeset and apply further changesets from there
91 # d, drop = remove commit from history
92 # f, fold = use commit, but combine it with the one above
93 # r, roll = like fold, but discard this commit's description and date
94 #
95 $ cd ..
96
97 test sensitivity to branch in URL:
98
99 $ cd r2
100 $ hg -q update 2
101 $ hg -q branch foo
102 $ hg commit -m 'create foo branch'
103 $ HGEDITOR=cat hg histedit --outgoing '../r#foo' | grep -v comparing | grep -v searching
104 pick f26599ee3441 6 create foo branch
105
106 # Edit history between f26599ee3441 and f26599ee3441
107 #
108 # Commits are listed from least to most recent
109 #
110 # You can reorder changesets by reordering the lines
111 #
112 # Commands:
113 #
114 # e, edit = use commit, but allow edits before making new commit
115 # m, mess = edit commit message without changing commit content
116 # p, pick = use commit
117 # b, base = checkout changeset and apply further changesets from there
118 # d, drop = remove commit from history
119 # f, fold = use commit, but combine it with the one above
120 # r, roll = like fold, but discard this commit's description and date
121 #
122
123 test to check number of roots in outgoing revisions
124
125 $ hg -q outgoing -G --template '{node|short}({branch})' '../r'
126 @ f26599ee3441(foo)
127
128 o 652413bf663e(default)
129 |
130 o e860deea161a(default)
131 |
132 o 055a42cdd887(default)
133
134 $ HGEDITOR=cat hg -q histedit --outgoing '../r'
135 abort: there are ambiguous outgoing revisions
136 (see 'hg help histedit' for more detail)
137 [20]
138
139 $ hg -q update -C 2
140 $ echo aa >> a
141 $ hg -q commit -m 'another head on default'
142 $ hg -q outgoing -G --template '{node|short}({branch})' '../r#default'
143 @ 3879dc049647(default)
144
145 o 652413bf663e(default)
146 |
147 o e860deea161a(default)
148 |
149 o 055a42cdd887(default)
150
151 $ HGEDITOR=cat hg -q histedit --outgoing '../r#default'
152 abort: there are ambiguous outgoing revisions
153 (see 'hg help histedit' for more detail)
154 [20]
155
156 $ cd ..